#45382 [Opn->Csd]: [PATCH] timeout bug in stream_socket_enable_crypto
| From: | iliaa@php.net | Date: | Thu, 11 Sep 2008 23:57:07 +0000 |
| Subject: | #45382 [Opn->Csd]: [PATCH] timeout bug in stream_socket_enable_crypto | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128895@lists.php.net to get a copy of this message | ||
ID: 45382
Updated by: iliaa@php.net
Reported By: vnegrier at optilian dot com
-Status: Open
+Status: Closed
Bug Type: OpenSSL related
Operating System: linux 2.6
PHP Version: 5.2.6
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2008-06-27 19:11:02] vnegrier at optilian dot com
Description:
------------
there's a bug in the stream_socket_enable_crypto() timeout test: the
"timeout" var is only decremented when tve.sec and tvs.sec differ
because (at least with gcc-4.3.1) "tv_usec / 1000000" is cast as int,
leading to timeout inaccuracy, fix below :
--- xp_ssl.c.orig 2008-06-27 21:02:58.000000000 +0200
+++ xp_ssl.c 2008-06-27 21:03:07.000000000 +0200
@@ -418,7 +418,7 @@
n = SSL_connect(sslsock->ssl_handle);
gettimeofday(&tve, &tz);
- timeout -= (tve.tv_sec + tve.tv_usec /
1000000) - (tvs.tv_sec + tvs.tv_usec / 1000000);
+ timeout -= (tve.tv_sec +
(float)tve.tv_usec / 1000000) - (tvs.tv_sec + (float)tvs.tv_usec /
1000000);
if (timeout < 0) {
php_error_docref(NULL
TSRMLS_CC, E_WARNING, "SSL: connection timeout");
return -1;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45382&edit=1