summaryrefslogtreecommitdiffhomepage
path: root/plugins/fcgi/fcgi.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-30 22:40:52 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-30 22:40:52 +0200
commitb715de1eb6f937b0a05d91842041a54455946061 (patch)
tree8ff497cf574be954bacc3c8844446cbc740ead43 /plugins/fcgi/fcgi.cpp
parented3fcf6ef315fc6fe1519f0c67377267bd95666d (diff)
Bugfixes: write timeout and output size
Diffstat (limited to 'plugins/fcgi/fcgi.cpp')
-rw-r--r--plugins/fcgi/fcgi.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/plugins/fcgi/fcgi.cpp b/plugins/fcgi/fcgi.cpp
index 22a4d40..0d845a6 100644
--- a/plugins/fcgi/fcgi.cpp
+++ b/plugins/fcgi/fcgi.cpp
@@ -453,7 +453,6 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context)
}
std::istringstream is_out{output_data};
- std::string output;
std::string line;
// TODO: C++20 coroutine
@@ -469,25 +468,19 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context)
// read empty line
if (!isEmpty(line))
throw std::runtime_error("Missing empty line between CGI header and body");
- if (in)
- in();
- // read remainder
- while (in) {
- line = in.get();
- output += line + '\n';
+ if (in)
in();
- }
-
- throw std::runtime_error("Input missing on processing CGI body");
});
do {
std::getline(is_out, line);
processLine(line);
- } while (!is_out.eof());
+ } while (!is_out.eof() && !isEmpty(line));
+
+ std::string r = output_data.substr(is_out.tellg());
- return output;
+ return r;
}
std::string fcgi_plugin::name()