X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fhelper%2Fpipeline.inc;fp=tests%2Fhelper%2Fpipeline.inc;h=942d254ea8b316b0eb188bfba00a3f3f1e0c9727;hp=b7175c109fac1b24d4f4a31e000e08cda288ae4d;hb=a4df85a0ee26bd18d7f7780c19829e3902b11426;hpb=7741e113eaa782b365b7d6e2b87036e29cd59a41 diff --git a/tests/helper/pipeline.inc b/tests/helper/pipeline.inc index b7175c1..942d254 100644 --- a/tests/helper/pipeline.inc +++ b/tests/helper/pipeline.inc @@ -11,16 +11,18 @@ function respond($client, $msg) { serve(function($client) { $count = trim(fgets(STDIN)); - + logger("Expecting %d messages", $count); /* the peek message */ respond($client, new http\Message($client, false)); - + logger("Handled the peek request"); /* pipelined messages */ $req = array(); for ($i=0; $i < $count; ++ $i) { $req[] = new http\Message($client, false); + logger("Read request no. %d", $i+1); } - foreach ($req as $msg) { + foreach ($req as $i => $msg) { respond($client, $msg); + logger("Sent response no. %d", $i+1); } });