#45016 [NoF->Fbk]: connect timeout on successful connect
| From: | felipe@php.net | Date: | Wed, 11 Feb 2009 21:36:14 +0000 |
| Subject: | #45016 [NoF->Fbk]: connect timeout on successful connect | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133742@lists.php.net to get a copy of this message | ||
ID: 45016
Updated by: felipe@php.net
Reported By: tpowell at electric-cloud dot com
-Status: No Feedback
+Status: Feedback
Bug Type: OpenSSL related
Operating System: *
PHP Version: 5.3CVS-2008-05-16 (CVS)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2008-07-22 01:00:02] 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".
------------------------------------------------------------------------
[2008-07-14 21:09:24] jani@php.net
Can you try the patch Kalle posted above?
------------------------------------------------------------------------
[2008-07-08 01:39:54] kalle@php.net
Try this patch:
http://phpfi.com/330065 (against latest PHP_5_3 cvs)
------------------------------------------------------------------------
[2008-05-16 00:12:40] tpowell at electric-cloud dot com
Description:
------------
On unusually slow ssl connects, we get a timeout message even through
the connect succeeded.
The offending code appears to be around line 816 of xp_ssl.c version
1.37 (the bug appears to have been around since 1.28)
struct timeval tvs, tve;
struct timezone tz;
gettimeofday(&tvs, &tz);
n = SSL_connect(sslsock->ssl_handle);
gettimeofday(&tve, &tz);
timeout -= (tve.tv_sec + tve.tv_usec /
1000000) - (tvs.tv_sec + tvs.tv_usec / 1000000);
if (timeout < 0) {
php_error_docref(NULL
TSRMLS_CC, E_WARNING, "SSL: connection timeout");
return -1;
}
The timeout is checked before the success value. A fix would be to
only check the timeout when deciding to loop again.
Reproduce code:
---------------
Peg the cpu of the test machine, attempt to make several ssl
connections out.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45016&edit=1