Skip to content

Commit caf3913

Browse files
committed
Run stream_server_reneg_limit.phpt on Windows, too
As is, the client code may block on Windows when trying to read STDERR; if that happens, neither the openssl nor the php processes would be terminated, causing further issues for the test suite. We fix this by using `stream_select()` and only read if there is data available. This may cause some delay until we hit the timeout, but it might be necessary to "empty" STDERR.
1 parent 18ba983 commit caf3913

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/openssl/tests/stream_server_reneg_limit.phpt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ openssl
77
if (!function_exists("proc_open")) die("skip no proc_open");
88
exec('openssl help', $out, $code);
99
if ($code > 0) die("skip couldn't locate openssl binary");
10-
if(substr(PHP_OS, 0, 3) == 'WIN') {
11-
die('skip not suitable for Windows');
12-
}
1310
?>
1411
--FILE--
1512
<?php
@@ -83,8 +80,9 @@ $clientCode = <<<'CODE'
8380
// Server settings only allow one per second (should result in disconnection)
8481
fwrite($stdin, "R\nR\nR\nR\n");
8582
86-
$lines = [];
87-
while(!feof($stderr)) {
83+
$r = [$stderr];
84+
$w = $e = null;
85+
while (stream_select($r, $w, $e, 1) > 0) {
8886
fgets($stderr);
8987
}
9088

0 commit comments

Comments
 (0)