projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (from parent 1:
a4df85a
)
timeout on stdin
author
Michael Wallner
<mike@php.net>
Mon, 3 Aug 2015 11:48:28 +0000
(13:48 +0200)
committer
Michael Wallner
<mike@php.net>
Mon, 3 Aug 2015 11:48:28 +0000
(13:48 +0200)
tests/helper/pipeline.inc
patch
|
blob
|
history
diff --git
a/tests/helper/pipeline.inc
b/tests/helper/pipeline.inc
index 942d254ea8b316b0eb188bfba00a3f3f1e0c9727..a6b16999c373b3835396edd44f17e5e4428e554f 100644
(file)
--- a/
tests/helper/pipeline.inc
+++ b/
tests/helper/pipeline.inc
@@
-10,19
+10,24
@@
function respond($client, $msg) {
}
serve(function($client) {
}
serve(function($client) {
+ $R = array(STDIN); $W = $E = array();
+ if (!stream_select($R, $W, $E, 10, 0)) {
+ logger("Client %d timed out", (int) $client);
+ return;
+ }
$count = trim(fgets(STDIN));
$count = trim(fgets(STDIN));
- logger("Expecting %d messages
", $cou
nt);
+ logger("Expecting %d messages
from client %d", $count, (int) $clie
nt);
/* the peek message */
respond($client, new http\Message($client, false));
/* the peek message */
respond($client, new http\Message($client, false));
- logger("Handled the peek request
"
);
+ logger("Handled the peek request
of client %d", (int) $client
);
/* pipelined messages */
$req = array();
for ($i=0; $i < $count; ++ $i) {
$req[] = new http\Message($client, false);
/* pipelined messages */
$req = array();
for ($i=0; $i < $count; ++ $i) {
$req[] = new http\Message($client, false);
- logger("Read request no. %d
", $i+1
);
+ logger("Read request no. %d
from client %d", $i+1, (int) $client
);
}
foreach ($req as $i => $msg) {
respond($client, $msg);
}
foreach ($req as $i => $msg) {
respond($client, $msg);
- logger("Sent response no. %d
", $i+1
);
+ logger("Sent response no. %d
to client %d", $i+1, (int) $client
);
}
});
}
});