attempt to fix test on curl-master
authorMichael Wallner <root@s201809.m6w6.name>
Wed, 23 Oct 2024 13:08:15 +0000 (15:08 +0200)
committerMichael Wallner <root@s201809.m6w6.name>
Wed, 23 Oct 2024 13:08:15 +0000 (15:08 +0200)
tests/client028.phpt
tests/gh-issue50.phpt
tests/helper/server.inc

index 482fc6c75344aba14add24ed2990d98cebc42c35..67863c1e640ea5260bb2515de29613ad908ddb3e 100644 (file)
@@ -71,10 +71,10 @@ class UserHandler implements http\Client\Curl\User
        function once() {
                echo "O";
 
-               foreach ($this->W as $w) {
+               foreach ($this->W as $w) if (is_resource($w)) {
                        call_user_func($this->run, $this->client, $w, self::POLL_OUT);
                }
-               foreach ($this->R as $r) {
+               foreach ($this->R as $r) if (is_resource($r)) {
                        call_user_func($this->run, $this->client, $r, self::POLL_IN);
                }
                return count($this->client);
index 57cbd9a6ce786d93c09cd5f6fb3f0164aa9515fb..4db06fe9e58e24c2ee00d77efe48add26f2deeff 100644 (file)
@@ -35,7 +35,7 @@ Test
 http\Exception\RuntimeException: http\Client::dequeue(): Could not dequeue request while executing callbacks in %sgh-issue50.php:9
 Stack trace:
 #0 %sgh-issue50.php(9): http\Client->dequeue(Object(http\Client\Request))
-#1 [internal function]: {closure}(Object(http\Client), Object(http\Client\Request), 18, 'GET / HTTP/1.1%s...')
+#1 [internal function]: {closur%s}(Object(http\Client), Object(http\Client\Request), 18, 'GET / HTTP/1.1%s...')
 #2 %sgh-issue50.php(14): http\Client->send()
 #3 {main}
 ===DONE===
index b5bc3b7f4564d014b8636870c2de1bd51bf92bba..3046448de67b8c0f319a7d9f663b9cb69d799d25 100644 (file)
@@ -83,7 +83,7 @@ function serve($cb) {
                        logger("serve: Using port %d", $port);
                        do {
                                $R = array($server); $W = array(); $E = array();
-                               $select = stream_select($R, $E, $E, 10, 0);
+                               $select = stream_select($R, $E, $E, 1, 0);
                                if ($select && ($client = stream_socket_accept($server, 1))) {
                                        logger("serve: Accept client %d", (int) $client);
                                        if (getenv("PHP_HTTP_TEST_SSL")) {