diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-05-01 11:19:21 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-05-01 11:19:21 +0200 |
commit | b77bb246e366d346b55cc8cfb4f1d0ac83211ae7 (patch) | |
tree | d3fda755578a4fb4084e2b4f02252c498201ed0e /plugins/cgi/cgi.cpp | |
parent | 82558fb7bfd7b0a36119d23bcd47d4cd4bd7b970 (diff) |
Added fcgi module (WIP)
Diffstat (limited to 'plugins/cgi/cgi.cpp')
-rw-r--r-- | plugins/cgi/cgi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp index 318dd1f..75e401e 100644 --- a/plugins/cgi/cgi.cpp +++ b/plugins/cgi/cgi.cpp @@ -173,7 +173,7 @@ namespace { env["HTTPS"] = c.GetRequestParam("https"); } - std::string executeFile(const fs::path& filename, CGIContext& context) + std::string executeFile(CGIContext& context) { bp::pipe is_in; bp::ipstream is_out; @@ -181,7 +181,7 @@ namespace { bp::environment env {boost::this_process::environment()}; setCGIEnvironment(env, context); - bp::child child(filename.string(), env, bp::std_out > is_out, bp::std_err > stderr, bp::std_in < is_in); + bp::child child(context.path.string(), env, bp::std_out > is_out, bp::std_err > stderr, bp::std_in < is_in); std::string body{ context.GetRequestParam("body") }; is_in.write(body.data(), body.size()); @@ -311,7 +311,7 @@ std::string cgi_plugin::generate_page( CGIContext context(GetServerParam, GetRequestParam, SetResponseHeader, path, file_path, path_info); try { - return executeFile(path, context); + return executeFile(context); } catch (const std::runtime_error& ex) { return HttpStatus("404", "Not found: "s + GetRequestParam("target"), SetResponseHeader); } catch (const std::exception& ex) { |