cvs: php-src(PHP_5_0) /ext/sockets sockets.c
| From: | Wez Furlong | Date: | Tue, 28 Sep 2004 09:30:23 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/sockets sockets.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-28812@lists.php.net to get a copy of this message | ||
wez Tue Sep 28 05:30:23 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/sockets sockets.c
Log:
MFH: select usage fix
http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.165&r2=1.165.2.1&ty=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.165 php-src/ext/sockets/sockets.c:1.165.2.1
--- php-src/ext/sockets/sockets.c:1.165 Mon Jun 7 01:00:37 2004
+++ php-src/ext/sockets/sockets.c Tue Sep 28 05:30:20 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.165 2004/06/07 05:00:37 pollita Exp $ */
+/* $Id: sockets.c,v 1.165.2.1 2004/09/28 09:30:20 wez Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -533,7 +533,7 @@
php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1,
le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
- FD_SET(php_sock->bsd_socket, fds);
+ PHP_SAFE_FD_SET(php_sock->bsd_socket, fds);
if (php_sock->bsd_socket > *max_fd) {
*max_fd = php_sock->bsd_socket;
}
@@ -560,7 +560,7 @@
php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1,
le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
- if (FD_ISSET(php_sock->bsd_socket, fds)) {
+ if (PHP_SAFE_FD_ISSET(php_sock->bsd_socket, fds)) {
/* Add fd to new array */
zend_hash_next_index_insert(new_hash, (void *)element, sizeof(zval *), (void
**)&dest_element);
if (dest_element) zval_add_ref(dest_element);
@@ -604,6 +604,8 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, "no resource arrays were passed to
select");
RETURN_FALSE;
}
+
+ PHP_SAFE_MAX_FD(max_fd, 0); /* someone needs to make this look more like stream_socket_select */
/* If seconds is not set to null, build the timeval, else we wait indefinitely */
if (sec != NULL) {