diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/fcgi/fcgi.cpp | 17 | 
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()  | 
