]> granicus.if.org Git - php/commitdiff
Fixed bug #38096 (large timeout values ignored on 32bit machines in
authorIlia Alshanetsky <iliaa@php.net>
Mon, 11 Sep 2006 14:52:21 +0000 (14:52 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 11 Sep 2006 14:52:21 +0000 (14:52 +0000)
stream_socket_accept() and stream_socket_client()).

NEWS
ext/standard/streamsfuncs.c

diff --git a/NEWS b/NEWS
index d77d9086045da7fc73410bf65e9d915a7f808d7f..647c082f4530c916d9ee3a85a92efc33dd2c859f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@
 - Fixed bug #38661 (mixed-case URL breaks url-wrappers). (Ilia)
 - Fixed bug #38464 (array_count_values() mishandles numeric strings). 
   (php_lists at realplain dot com, Ilia)
+- Fixed bug #38096 (large timeout values ignored on 32bit machines in
+  stream_socket_accept() and stream_socket_client()). (Ilia)
 
 31 Aug 2006, PHP 5.2.0RC3
 - Updated PCRE to version 6.7. (Ilia)
index a9c5b85751055175830e42610d2c89435be41278..15fc3da32c71dfa34da952e1e10b6afc3555ec34 100644 (file)
 
 #ifndef PHP_WIN32
 #define php_select(m, r, w, e, t)      select(m, r, w, e, t)
+typedef unsigned long long php_timeout_ull;
 #else
 #include "win32/select.h"
+typedef unsigned __int64 php_timeout_ull;
 #endif
 
 static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
@@ -81,7 +83,7 @@ PHP_FUNCTION(stream_socket_client)
        int host_len;
        zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL;
        double timeout = FG(default_socket_timeout);
-       unsigned long conv;
+       php_timeout_ull conv;
        struct timeval tv;
        char *hashkey = NULL;
        php_stream *stream = NULL;
@@ -103,7 +105,7 @@ PHP_FUNCTION(stream_socket_client)
        }
        
        /* prepare the timeout value for use */
-       conv = (unsigned long) (timeout * 1000000.0);
+       conv = (php_timeout_ull) (timeout * 1000000.0);
        tv.tv_sec = conv / 1000000;
        tv.tv_usec = conv % 1000000;
 
@@ -231,7 +233,7 @@ PHP_FUNCTION(stream_socket_accept)
 {
        double timeout = FG(default_socket_timeout);
        zval *peername = NULL;
-       unsigned long conv;
+       php_timeout_ull conv;
        struct timeval tv;
        php_stream *stream = NULL, *clistream = NULL;
        zval *zstream;
@@ -245,7 +247,7 @@ PHP_FUNCTION(stream_socket_accept)
        php_stream_from_zval(stream, &zstream);
        
        /* prepare the timeout value for use */
-       conv = (unsigned long) (timeout * 1000000.0);
+       conv = (php_timeout_ull) (timeout * 1000000.0);
        tv.tv_sec = conv / 1000000;
        tv.tv_usec = conv % 1000000;