From: Ilia Alshanetsky Date: Thu, 11 Sep 2008 23:56:57 +0000 (+0000) Subject: MFB: Fixed bug #45382 (timeout bug in stream_socket_enable_crypto). X-Git-Tag: BEFORE_HEAD_NS_CHANGE~424 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f267153613477a9ec583f377ecfa752359667b48;p=php MFB: Fixed bug #45382 (timeout bug in stream_socket_enable_crypto). --- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index ea7ffa63f1..a6b3a4b7e7 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -417,7 +417,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream, 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;