diff options
Diffstat (limited to 'mod/external-handler.cxx')
-rw-r--r-- | mod/external-handler.cxx | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/mod/external-handler.cxx b/mod/external-handler.cxx index 4c1a86f..3a85bd8 100644 --- a/mod/external-handler.cxx +++ b/mod/external-handler.cxx @@ -13,9 +13,10 @@ #include <type_traits> // static_assert #include <system_error> // error_code, generic_category() -#include <libbutl/process.mxx> -#include <libbutl/fdstream.mxx> -#include <libbutl/process-io.mxx> // operator<<(ostream, process_args) +#include <libbutl/process.hxx> +#include <libbutl/fdstream.hxx> +#include <libbutl/process-io.hxx> // operator<<(ostream, process_args) +#include <libbutl/manifest-parser.hxx> using namespace std; using namespace butl; @@ -95,15 +96,18 @@ namespace brep data_dir)); pipe.out.close (); + // Kill the process and wait for its completion. + // auto kill = [&pr, &warn, &handler, &ref] () - { - // We may still end up well (see below), thus this is a warning. - // - warn << "ref " << ref << ": process " << handler - << " execution timeout expired"; + { + // We may still end up well (see below), thus this is a warning. + // + warn << "ref " << ref << ": process " << handler + << " execution timeout expired"; - pr.kill (); - }; + pr.kill (); + pr.wait (); + }; try { @@ -126,7 +130,7 @@ namespace brep } timeval tm {wd.count () / 1000 /* seconds */, - wd.count () % 1000 * 1000 /* microseconds */}; + wd.count () % 1000 * 1000 /* microseconds */}; fd_set rd; FD_ZERO (&rd); @@ -313,7 +317,7 @@ namespace brep assert (e != nullptr); if (!(*e == '\0' && c >= 100 && c < 600)) - bad_value ("invalid HTTP status '" + v + "'"); + bad_value ("invalid HTTP status '" + v + '\''); // Save the HTTP status. // |