php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43796 stream_set_timeout() does not work with ssl
Submitted: 2008-01-09 10:52 UTC Modified: 2008-05-27 01:00 UTC
Votes:14
Avg. Score:4.8 ± 0.6
Reproduced:13 of 13 (100.0%)
Same Version:5 (38.5%)
Same OS:7 (53.8%)
From: kirsch at mediafinanz dot de Assigned:
Status: No Feedback Package: Streams related
PHP Version: 5.2.5 OS: Windows XP SP 2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-01-09 10:52 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC