From: kirsch at mediafinanz dot de Operating system: Windows XP SP 2 PHP version: 5.2.5 PHP Bug Type: Streams related Bug description: stream_set_timeout doesn't work with ssl
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 bug report at http://bugs.php.net/?id=43796&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43796&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43796&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43796&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43796&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43796&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43796&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43796&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43796&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43796&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43796&r=support Expected behavior: http://bugs.php.net/fix.php?id=43796&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43796&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43796&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43796&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43796&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43796&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43796&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43796&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43796&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43796&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43796&r=mysqlcfg