mirror of
https://github.com/php/php-src.git
synced 2026-04-26 09:28:21 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Re-fix GH-8409: SSL handshake timeout persistent connections hanging Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"
This commit is contained in:
@@ -2,19 +2,24 @@
|
||||
GH-8409: Error in socket creation when error handler does not clean persistent connection
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function($errno, $errstring, $errfile, $errline) {
|
||||
foreach (get_resources() as $res) {
|
||||
if (get_resource_type($res) === "persistent stream") {
|
||||
echo "ERROR: persistent stream not closed\n";
|
||||
}
|
||||
}
|
||||
echo "DONE\n";
|
||||
exit(1);
|
||||
set_error_handler(function (int $errno, string $errstring): never {
|
||||
trigger_error($errstring, E_USER_ERROR);
|
||||
});
|
||||
|
||||
stream_socket_client("tcp://9999.9999.9999.9999:9999", $error_code, $error_message, 0.2, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT);
|
||||
register_shutdown_function(function (): void {
|
||||
foreach (get_resources() as $res) {
|
||||
if (get_resource_type($res) === 'persistent stream') {
|
||||
echo "ERROR: persistent stream not closed\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
echo "OK: persistent stream closed\n";
|
||||
});
|
||||
|
||||
stream_socket_client('tcp://9999.9999.9999.9999:9999', $error_code, $error_message, 0.2, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT);
|
||||
|
||||
echo "ERROR: this should not be visible\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Fatal error: stream_socket_client(): %s in %sgh8409.php on line %d
|
||||
OK: persistent stream closed
|
||||
|
||||
Reference in New Issue
Block a user