X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fhelper%2Fserver.inc;h=af71a0e2a66f2244ed350f0801e46fa5cb1e6aed;hp=506e08313b2c70f71a97f494bb5097171bc7a1f0;hb=71f54fe93cc20ac23c317fd6c7aa93732e9aa766;hpb=f77326f8677648ea24c5906d05088fc79b9bb4e7 diff --git a/tests/helper/server.inc b/tests/helper/server.inc index 506e083..af71a0e 100644 --- a/tests/helper/server.inc +++ b/tests/helper/server.inc @@ -1,5 +1,19 @@ getMessage()); /* ignore disconnect */ if ($ex->getMessage() !== "Empty message received from stream") { fprintf(STDERR, "%s\n", $ex); @@ -37,7 +70,7 @@ function serve($cb) { break; } } - } while ($select !== false); + } while ($select); return; } } @@ -62,9 +95,9 @@ function nghttpd($cb) { $stdout = $pipes[1]; $stderr = $pipes[2]; - usleep(50000); + sleep(1); $status = proc_get_status($proc); - + logger("nghttpd: %s", new http\Params($status)); if (!$status["running"]) { continue; } @@ -88,6 +121,7 @@ function nghttpd($cb) { function proc($bin, $args, $cb) { $spec = array(array("pipe","r"), array("pipe","w"), array("pipe","w")); $comm = escapeshellcmd($bin) . " ". implode(" ", array_map("escapeshellarg", $args)); + logger("proc: %s %s", $bin, implode(" ", $args)); if (($proc = proc_open($comm, $spec, $pipes, __DIR__))) { $stdin = $pipes[0]; $stdout = $pipes[1]; @@ -111,4 +145,4 @@ function proc($bin, $args, $cb) { fpassthru($stderr); fpassthru($stdout); } -} \ No newline at end of file +}