ID:               43796
 Updated by:       [EMAIL PROTECTED]
 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

Reply via email to