Bug #69393 [Com]: fread() function on TLS stream timeout
| From: | pk at maybe-phil dot net | Date: | Thu, 09 Apr 2015 11:14:52 +0000 |
| Subject: | Bug #69393 [Com]: fread() function on TLS stream timeout | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191919@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69393&edit=1
ID: 69393
Comment by: pk at maybe-phil dot net
Reported by: contact at sshilko dot com
Summary: fread() function on TLS stream timeout
Status: Open
Type: Bug
Package: Streams related
Operating System: Linux
PHP Version: 5.5.23
Block user comment: N
Private report: N
New Comment:
5.6.7 is also affected.
Previous Comments:
------------------------------------------------------------------------
[2015-04-07 11:17:50] contact at sshilko dot com
The actual time it takes for fread() is the stream_socket_client.timeout argument actually, even
wehn the documentation says
To set a timeout for reading/writing data over the socket, use the stream_set_timeout(), as the
timeout only applies while making connecting the socket.
in 5.5.23 this timeout is also used for fread() call.
------------------------------------------------------------------------
[2015-04-07 10:29:16] contact at sshilko dot com
Description:
------------
The fread() call on TLS (SSL) stream times out after 60 seconds and does not honor the
stream_set_timeout() values.
5.5.23 (tested) and probably 5.6.7 affected, 5.5.22 worked fine.
Related git threads:
https://github.com/duccio/ApnsPHP/issues/84
https://github.com/php/php-src/pull/971
Test script:
---------------
https://gist.github.com/sshilko/41f04ddaaf5f73f0bb91
Expected result:
----------------
PHP 5.5.22-1+deb.sury.org~precise+1 (cli) (built: Feb 20 2015 11:25:27)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
Sending 172 bytes over tls://gateway.sandbox.push.apple.com:2195:
Socket state:
Array
(
[stream_type] => tcp_socket/ssl
[mode] => r+
[unread_bytes] => 0
[seekable] =>
[timed_out] =>
[blocked] =>
[eof] =>
)
Timeout set: 1
Has errors:
string(0) ""
real 0m0.261s
user 0m0.040s
sys 0m0.036s
Actual result:
--------------
PHP 5.5.23-1+deb.sury.org~precise+2 (cli) (built: Mar 24 2015 11:00:01)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
Sending 172 bytes over tls://gateway.sandbox.push.apple.com:2195:
Socket state:
Array
(
[stream_type] => tcp_socket/ssl
[mode] => r+
[unread_bytes] => 0
[seekable] =>
[timed_out] =>
[blocked] =>
[eof] =>
)
Timeout set: 1
Has errors:
string(0) ""
real 1m0.305s
user 0m19.553s
sys 0m39.170s
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69393&edit=1