iliaa Mon Sep 11 14:53:34 2006 UTC
Modified files:
/php-src/ext/standard streamsfuncs.c
Log:
MFB: Fixed bug #38096 (large timeout values ignored on 32bit machines in
stream_socket_accept() and stream_socket_client()).
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.83&r2=1.84&diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.83
php-src/ext/standard/streamsfuncs.c:1.84
--- php-src/ext/standard/streamsfuncs.c:1.83 Thu Aug 31 14:41:15 2006
+++ php-src/ext/standard/streamsfuncs.c Mon Sep 11 14:53:33 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.83 2006/08/31 14:41:15 tony2001 Exp $ */
+/* $Id: streamsfuncs.c,v 1.84 2006/09/11 14:53:33 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -33,8 +33,10 @@
#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 @@
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 @@
}
/* 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 @@
{
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_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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php