|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-11 23:57 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
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;