]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #45382 (timeout bug in stream_socket_enable_crypto).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 11 Sep 2008 23:56:57 +0000 (23:56 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 11 Sep 2008 23:56:57 +0000 (23:56 +0000)
ext/openssl/xp_ssl.c

index ea7ffa63f18e0064318a866ead4eebd6057ee41e..a6b3a4b7e7c1d51429df85f10665c8f31629b287 100644 (file)
@@ -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;