projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't go beyond end of string for quoted literals
[metaproxy-moved-to-github.git]
/
src
/
filter_cgi.cpp
diff --git
a/src/filter_cgi.cpp
b/src/filter_cgi.cpp
index
fd844c7
..
6a452ad
100644
(file)
--- a/
src/filter_cgi.cpp
+++ b/
src/filter_cgi.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2005-2011 Index Data
+ Copyright (C) 2005-2013 Index Data
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-54,14
+54,14
@@
namespace metaproxy_1 {
yf::CGI::CGI() : m_p(new Rep)
{
yf::CGI::CGI() : m_p(new Rep)
{
-
+
}
yf::CGI::Rep::~Rep()
{
std::map<pid_t,pid_t>::const_iterator it;
boost::mutex::scoped_lock lock(m_mutex);
}
yf::CGI::Rep::~Rep()
{
std::map<pid_t,pid_t>::const_iterator it;
boost::mutex::scoped_lock lock(m_mutex);
-
+
for (it = children.begin(); it != children.end(); it++)
kill(it->second, SIGTERM);
}
for (it = children.begin(); it != children.end(); it++)
kill(it->second, SIGTERM);
}
@@
-74,10
+74,10
@@
void yf::CGI::process(mp::Package &package) const
{
Z_GDU *zgdu_req = package.request().get();
Z_GDU *zgdu_res = 0;
{
Z_GDU *zgdu_req = package.request().get();
Z_GDU *zgdu_res = 0;
-
+
if (!zgdu_req)
return;
if (!zgdu_req)
return;
-
+
if (zgdu_req->which != Z_GDU_HTTP_Request)
{
package.move();
if (zgdu_req->which != Z_GDU_HTTP_Request)
{
package.move();
@@
-105,7
+105,7
@@
void yf::CGI::process(mp::Package &package) const
int r;
pid_t pid;
int status;
int r;
pid_t pid;
int status;
-
+
pid = ::fork();
switch (pid)
{
pid = ::fork();
switch (pid)
{
@@
-146,7
+146,7
@@
void yf::CGI::process(mp::Package &package) const
package.move();
}
package.move();
}
-void yf::CGI::configure(const xmlNode *ptr, bool test_only)
+void yf::CGI::configure(const xmlNode *ptr, bool test_only, const char *path)
{
for (ptr = ptr->children; ptr; ptr = ptr->next)
{
{
for (ptr = ptr->children; ptr; ptr = ptr->next)
{
@@
-165,7
+165,7
@@
void yf::CGI::configure(const xmlNode *ptr, bool test_only)
exec.program = mp::xml::get_text(attr->children);
else
throw mp::filter::FilterException
exec.program = mp::xml::get_text(attr->children);
else
throw mp::filter::FilterException
- ("Bad attribute "
+ ("Bad attribute "
+ std::string((const char *) attr->name)
+ " in cgi section");
}
+ std::string((const char *) attr->name)
+ " in cgi section");
}
@@
-173,7
+173,7
@@
void yf::CGI::configure(const xmlNode *ptr, bool test_only)
}
else
{
}
else
{
- throw mp::filter::FilterException("Bad element "
+ throw mp::filter::FilterException("Bad element "
+ std::string((const char *)
ptr->name));
}
+ std::string((const char *)
ptr->name));
}