#43796 [Opn->Fbk]: stream_set_timeout() does not work with ssl
| From: | jani@php.net | Date: | Mon, 19 May 2008 22:56:36 +0000 |
| Subject: | #43796 [Opn->Fbk]: stream_set_timeout() does not work with ssl | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125126@lists.php.net to get a copy of this message | ||
ID: 43796
Updated by: jani@php.net
Reported By: kirsch at mediafinanz dot de
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: Windows XP SP 2
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2008-01-09 10:52:16] kirsch at mediafinanz dot de
Description:
------------
The function stream_set_timeout seems not to work with ssl. The timeout
is ignored and the script runs till the maximum execution timeout is
reached. Problem occurred on my development PC (Windows XP SP 2, PHP
5.2.5, Apache 2.6) and also on our Test-System (SuSE Linux 10, PHP
5.2.1, Apache 2.4). stream_set_timeout works when not using ssl.
Reproduce code:
---------------
$fp = fsockopen("ssl://127.0.0.1", 443);
//endlessloop.php is simply running an endless while loop without
output
fwrite($fp, "GET /endlessloop.php HTTP/1.0\r\n\r\n");
$timeoutSet = stream_set_timeout($fp, 5);
if ($timeoutSet)
{
$res = fread($fp, 2000);
$info = stream_get_meta_data($fp);
if ($info['timed_out'])
{
echo 'Connection timed out!';flush();
}
else
{
echo $res;
}
fclose($fp);
}
Expected result:
----------------
After 5 seconds of trying to read an result without success, the
connection should time out and output "Connection timed out";
Actual result:
--------------
After 60 seconds of trying to read from the stream, the fatal error
"maximum execution time exeeded" occurrs.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43796&edit=1