From: Sterling Hughes Date: Fri, 1 Jun 2001 18:41:06 +0000 (+0000) Subject: # testing changes is a good idea. X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=015e1d3d68f3c365637180335fa136ec89b649d0;p=php # testing changes is a good idea. We were passing the php socket resource identifier to select instead of the socket fd... --- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index b192e6b1ee..cc591ab9d0 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -482,6 +482,7 @@ PHP_FUNCTION(socket_fd_zero) PHP_FUNCTION(socket_select) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6; + php_sock *php_sock; struct timeval tv; fd_set *rfds, *wfds, *xfds; @@ -489,16 +490,16 @@ PHP_FUNCTION(socket_select) WRONG_PARAM_COUNT; } - convert_to_long_ex(arg1); convert_to_long_ex(arg5); convert_to_long_ex(arg6); - ZEND_FETCH_RESOURCE(rfds, fd_set*, arg2, -1, "File descriptor set", le_destroy); - ZEND_FETCH_RESOURCE(wfds, fd_set*, arg3, -1, "File descriptor set", le_destroy); - ZEND_FETCH_RESOURCE(xfds, fd_set*, arg4, -1, "File descriptor set", le_destroy); + ZEND_FETCH_RESOURCE(php_sock, php_socket *, arg1, -1, "Socket", le_socket); + ZEND_FETCH_RESOURCE(rfds, fd_set *, arg2, -1, "File descriptor set", le_destroy); + ZEND_FETCH_RESOURCE(wfds, fd_set *, arg3, -1, "File descriptor set", le_destroy); + ZEND_FETCH_RESOURCE(xfds, fd_set *, arg4, -1, "File descriptor set", le_destroy); tv.tv_sec = Z_LVAL_PP(arg5); tv.tv_usec = Z_LVAL_PP(arg6); - RETURN_LONG(select(Z_LVAL_PP(arg1), rfds, wfds, xfds, &tv)); + RETURN_LONG(select(php_sock->socket, rfds, wfds, xfds, &tv)); } /* }}} */