From 9e1b58274e55161ff57e6efe3584235b8754d605 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Tue, 31 Dec 2024 13:39:33 +0100 Subject: [PATCH 1/2] Test stream_context_tcp_nodelay_server on Windows Closes GH-17308 --- .github/scripts/windows/test_task.bat | 3 ++- .../tests/streams/stream_context_tcp_nodelay_server.phpt | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index c4ac5c0de4588..29cf1e4f2b610 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -97,8 +97,9 @@ rem generate php.ini echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini -rem work-around for some spawned PHP processes requiring OpenSSL +rem work-around for some spawned PHP processes requiring OpenSSL and sockets echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini +echo extension=php_sockets.dll >> %PHP_BUILD_DIR%\php.ini rem remove ext dlls for which tests are not supported for %%i in (imap ldap oci8_12c pdo_firebird pdo_oci snmp) do ( diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt index 6f656ca15f9cc..e20e294180ccc 100644 --- a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt +++ b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt @@ -5,9 +5,6 @@ sockets --SKIPIF-- --FILE-- run($clientCode, $serverCode); ?> ---EXPECT-- +--EXPECTF-- server-delay:conn-nodelay + From 5b72f12c565594bdd1e242bfb7c15c7d20c785de Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Wed, 1 Jan 2025 11:20:23 +0100 Subject: [PATCH 2/2] Rewrite http gh16810 test to not be online Closes GH-17314 --- ext/standard/tests/http/gh16810.phpt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ext/standard/tests/http/gh16810.phpt b/ext/standard/tests/http/gh16810.phpt index 4aa563b57b270..6feab1fb01f86 100644 --- a/ext/standard/tests/http/gh16810.phpt +++ b/ext/standard/tests/http/gh16810.phpt @@ -1,16 +1,23 @@ --TEST-- -Bug #79265 variation: "host:" not at start of header +GH-16809 (fopen HTTP wrapper timeout stream context option overflow) --INI-- allow_url_fopen=1 --SKIPIF-- --FILE-- [ -'timeout' => PHP_INT_MIN, -], + 'http' => [ + 'timeout' => PHP_INT_MIN, + ], ]; $ctx = stream_context_create($config); var_dump(fopen($uri, "r", false, $ctx)); @@ -22,5 +29,5 @@ var_dump(fopen($uri, "r", false, $ctx)); --EXPECTF-- resource(%d) of type (stream) -Warning: fopen(http://www.example.com): Failed to open stream: timeout must be lower than %d in %s on line %d +Warning: fopen(http://%s): Failed to open stream: timeout must be lower than %d in %s on line %d bool(false)