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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
43 + 3 = ?
Subscribe to this entry?

 
 [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-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 06:03:34 2021 UTC