[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
andrei Thu Jun 4 18:17:43 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: MFB http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.19r2=1.171.2.9.2.14.2.20diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.19 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.20 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.19 Wed May 20 09:05:46 2009 +++ php-src/ext/sockets/sockets.c Thu Jun 4 18:17:43 2009 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.19 2009/05/20 09:05:46 lbarnaud Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.20 2009/06/04 18:17:43 andrei Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1611,10 +1611,11 @@ zval_dtor(arg5); zval_dtor(arg6); + memset(addr6, 0, INET6_ADDRSTRLEN); inet_ntop(AF_INET6, sin6.sin6_addr, addr6, INET6_ADDRSTRLEN); ZVAL_STRINGL(arg2, recv_buf, retval, 0); - ZVAL_STRING(arg5, addr6 ? addr6 : ::, 1); + ZVAL_STRING(arg5, addr6[0] ? addr6 : ::, 1); ZVAL_LONG(arg6, ntohs(sin6.sin6_port)); break; #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
lbarnaudWed May 20 09:05:46 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: MFH: Fixed bug #48326 (constant MSG_DONTWAIT not defined) http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.18r2=1.171.2.9.2.14.2.19diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.18 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.19 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.18 Sun May 10 01:03:45 2009 +++ php-src/ext/sockets/sockets.c Wed May 20 09:05:46 2009 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.18 2009/05/10 01:03:45 felipe Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.19 2009/05/20 09:05:46 lbarnaud Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -620,6 +620,9 @@ REGISTER_LONG_CONSTANT(SOCK_RDM, SOCK_RDM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(MSG_OOB, MSG_OOB, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(MSG_WAITALL, MSG_WAITALL,CONST_CS | CONST_PERSISTENT); +#ifdef MSG_DONTWAIT + REGISTER_LONG_CONSTANT(MSG_DONTWAIT, MSG_DONTWAIT, CONST_CS | CONST_PERSISTENT); +#endif REGISTER_LONG_CONSTANT(MSG_PEEK, MSG_PEEK, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(MSG_DONTROUTE, MSG_DONTROUTE, CONST_CS | CONST_PERSISTENT); #ifdef MSG_EOR -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
felipe Sun May 10 01:03:45 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: - MFH: Fixed memory leak (patch by Christian Weiske) http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.17r2=1.171.2.9.2.14.2.18diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.17 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.18 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.17 Thu Apr 16 05:33:13 2009 +++ php-src/ext/sockets/sockets.c Sun May 10 01:03:45 2009 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.17 2009/04/16 05:33:13 pajoye Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.18 2009/05/10 01:03:45 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1563,6 +1563,7 @@ sin.sin_family = AF_INET; if (arg6 == NULL) { + efree(recv_buf); WRONG_PARAM_COUNT; } @@ -1591,6 +1592,7 @@ sin6.sin6_family = AF_INET6; if (arg6 == NULL) { + efree(recv_buf); WRONG_PARAM_COUNT; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
pajoye Thu Apr 16 05:33:13 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: - #47978, typo in ext/sockets/sockets.c http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.16r2=1.171.2.9.2.14.2.17diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.16 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.17 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.16 Tue Feb 3 19:22:55 2009 +++ php-src/ext/sockets/sockets.c Thu Apr 16 05:33:13 2009 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.16 2009/02/03 19:22:55 iliaa Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.17 2009/04/16 05:33:13 pajoye Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -365,7 +365,7 @@ sock-type = PF_INET; if (bind(sock-bsd_socket, (struct sockaddr *)la, sizeof(la)) 0) { - PHP_SOCKET_ERROR(sock, unable to bind to given adress, errno); + PHP_SOCKET_ERROR(sock, unable to bind to given address, errno); close(sock-bsd_socket); efree(sock); return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
iliaa Tue Feb 3 19:22:55 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: MFB: Return empty string when recv() does not fetch any data http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.15r2=1.171.2.9.2.14.2.16diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.15 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.16 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.15 Sat Jan 24 13:06:21 2009 +++ php-src/ext/sockets/sockets.c Tue Feb 3 19:22:55 2009 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.15 2009/01/24 13:06:21 tony2001 Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.16 2009/02/03 19:22:55 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1046,6 +1046,9 @@ efree(tmpbuf); RETURN_FALSE; + } else if (!retval) { + efree(tmpbuf); + RETURN_EMPTY_STRING(); } tmpbuf = erealloc(tmpbuf, retval + 1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
tony2001Sat Jan 24 13:06:22 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: fix build http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.14r2=1.171.2.9.2.14.2.15diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.14 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.15 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.14 Fri Jan 23 15:49:48 2009 +++ php-src/ext/sockets/sockets.c Sat Jan 24 13:06:21 2009 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.14 2009/01/23 15:49:48 kalle Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.15 2009/01/24 13:06:21 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -51,7 +51,6 @@ # define set_errno(a) WSASetLastError(a) # define close(a) closesocket(a) #else -# include php_sockets.h # include sys/types.h # include sys/socket.h # include netdb.h @@ -67,6 +66,7 @@ # include sys/uio.h # define IS_INVALID_SOCKET(a) (a-bsd_socket 0) # define set_errno(a) (errno = a) +# include php_sockets.h #endif ZEND_DECLARE_MODULE_GLOBALS(sockets) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c /ext/sockets/tests ipv4loop.phpt ipv6loop.phpt unixloop.phpt /main/streams xp_socket.c
janiWed Jul 16 14:08:38 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/sockets/tests unixloop.phpt Modified files: /php-src/ext/socketssockets.c /php-src/ext/sockets/tests ipv4loop.phpt ipv6loop.phpt /php-src/main/streams xp_socket.c Log: MFH:- Fixed bug #44127 (UNIX abstract namespace socket connect does not work) http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.4r2=1.171.2.9.2.14.2.5diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.4 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.5 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.4Fri Jul 4 14:08:16 2008 +++ php-src/ext/sockets/sockets.c Wed Jul 16 14:08:38 2008 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.4 2008/07/04 14:08:16 felipe Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.5 2008/07/16 14:08:38 jani Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1328,8 +1328,8 @@ memset(s_un, 0, sizeof(struct sockaddr_un)); s_un.sun_family = AF_UNIX; - snprintf(s_un.sun_path, 108, %s, addr); - retval = connect(php_sock-bsd_socket, (struct sockaddr *) s_un, SUN_LEN(s_un)); + memcpy(s_un.sun_path, addr, addr_len); + retval = connect(php_sock-bsd_socket, (struct sockaddr *) s_un, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + addr_len); break; default: http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/tests/ipv4loop.phpt?r1=1.1r2=1.1.8.1diff_format=u Index: php-src/ext/sockets/tests/ipv4loop.phpt diff -u php-src/ext/sockets/tests/ipv4loop.phpt:1.1 php-src/ext/sockets/tests/ipv4loop.phpt:1.1.8.1 --- php-src/ext/sockets/tests/ipv4loop.phpt:1.1 Thu Apr 17 23:09:17 2003 +++ php-src/ext/sockets/tests/ipv4loop.phpt Wed Jul 16 14:08:38 2008 @@ -3,7 +3,7 @@ --SKIPIF-- ?php if (!extension_loaded('sockets')) { - die('skip sockets extenion not available.'); + die('skip sockets extension not available.'); } ? --FILE-- http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/tests/ipv6loop.phpt?r1=1.2.6.1r2=1.2.6.1.2.1diff_format=u Index: php-src/ext/sockets/tests/ipv6loop.phpt diff -u php-src/ext/sockets/tests/ipv6loop.phpt:1.2.6.1 php-src/ext/sockets/tests/ipv6loop.phpt:1.2.6.1.2.1 --- php-src/ext/sockets/tests/ipv6loop.phpt:1.2.6.1 Mon Feb 12 14:49:04 2007 +++ php-src/ext/sockets/tests/ipv6loop.phpt Wed Jul 16 14:08:38 2008 @@ -3,7 +3,7 @@ --SKIPIF-- ?php if (!extension_loaded('sockets')) { - die('skip sockets extenion not available.'); + die('skip sockets extension not available.'); } if (!defined(AF_INET6)) { die('skip no IPv6 support'); http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.33.2.2.2.6.2.4r2=1.33.2.2.2.6.2.5diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.33.2.2.2.6.2.4 php-src/main/streams/xp_socket.c:1.33.2.2.2.6.2.5 --- php-src/main/streams/xp_socket.c:1.33.2.2.2.6.2.4 Fri Jul 11 10:25:15 2008 +++ php-src/main/streams/xp_socket.cWed Jul 16 14:08:38 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.33.2.2.2.6.2.4 2008/07/11 10:25:15 tony2001 Exp $ */ +/* $Id: xp_socket.c,v 1.33.2.2.2.6.2.5 2008/07/16 14:08:38 jani Exp $ */ #include php.h #include ext/standard/file.h @@ -621,7 +621,7 @@ parse_unix_address(xparam, unix_addr TSRMLS_CC); ret = php_network_connect_socket(sock-socket, - (const struct sockaddr *)unix_addr, (socklen_t)sizeof(unix_addr), + (const struct sockaddr *)unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam-inputs.namelen, xparam-op == STREAM_XPORT_OP_CONNECT_ASYNC, xparam-inputs.timeout, xparam-want_errortext ? xparam-outputs.error_text : NULL, err); http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/tests/unixloop.phpt?view=markuprev=1.1 Index: php-src/ext/sockets/tests/unixloop.phpt +++ php-src/ext/sockets/tests/unixloop.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
felipe Fri Jul 4 14:08:16 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: - Added arginfo - Removed #include zend_arg_defs.c (it's unnecessary now) http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.3r2=1.171.2.9.2.14.2.4diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.3 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.4 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.3Thu Feb 21 02:56:57 2008 +++ php-src/ext/sockets/sockets.c Fri Jul 4 14:08:16 2008 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.3 2008/02/21 02:56:57 felipe Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.4 2008/07/04 14:08:16 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -94,66 +94,218 @@ static int le_socket; #define le_socket_name Socket +/* {{{ arginfo */ static - ZEND_BEGIN_ARG_INFO(first_through_third_args_force_ref, 0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(second_and_third_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); - -static - ZEND_BEGIN_ARG_INFO(second_fifth_and_sixth_args_force_ref, 0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(1) - ZEND_ARG_PASS_INFO(1) - ZEND_END_ARG_INFO(); +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_select, 0, 0, 4) + ZEND_ARG_INFO(1, read_fds) + ZEND_ARG_INFO(1, write_fds) + ZEND_ARG_INFO(1, except_fds) + ZEND_ARG_INFO(0, tv_sec) + ZEND_ARG_INFO(0, tv_usec) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_create_listen, 0, 0, 1) + ZEND_ARG_INFO(0, port) + ZEND_ARG_INFO(0, backlog) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_accept, 0, 0, 1) + ZEND_ARG_INFO(0, socket) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_set_nonblock, 0, 0, 1) + ZEND_ARG_INFO(0, socket) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_set_block, 0, 0, 1) + ZEND_ARG_INFO(0, socket) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_listen, 0, 0, 1) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, backlog) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_close, 0, 0, 1) + ZEND_ARG_INFO(0, socket) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_write, 0, 0, 2) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, buf) + ZEND_ARG_INFO(0, length) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_read, 0, 0, 2) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, length) + ZEND_ARG_INFO(0, type) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_getsockname, 0, 0, 2) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(1, addr) + ZEND_ARG_INFO(1, port) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_getpeername, 0, 0, 2) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(1, addr) + ZEND_ARG_INFO(1, port) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_create, 0, 0, 3) + ZEND_ARG_INFO(0, domain) + ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, protocol) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_connect, 0, 0, 2) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, addr) + ZEND_ARG_INFO(0, port) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_strerror, 0, 0, 1) + ZEND_ARG_INFO(0, errno) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_bind, 0, 0, 2) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, addr) + ZEND_ARG_INFO(0, port) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_recv, 0, 0, 4) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(1, buf) + ZEND_ARG_INFO(0, len) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_send, 0, 0, 4) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(0, buf) + ZEND_ARG_INFO(0, len) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_recvfrom, 0, 0, 5) + ZEND_ARG_INFO(0, socket) + ZEND_ARG_INFO(1, buf) + ZEND_ARG_INFO(0, len) + ZEND_ARG_INFO(0, flags) + ZEND_ARG_INFO(1, name) + ZEND_ARG_INFO(1, port) +ZEND_END_ARG_INFO() + +static
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/sockets sockets.c
felipe Thu Feb 21 02:56:57 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/socketssockets.c Log: MFB: Fixed Bug #44197 (socket array keys lost on socket_select) http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.14.2.2r2=1.171.2.9.2.14.2.3diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.2 php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.3 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.14.2.2Mon Dec 31 07:17:13 2007 +++ php-src/ext/sockets/sockets.c Thu Feb 21 02:56:57 2008 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: sockets.c,v 1.171.2.9.2.14.2.2 2007/12/31 07:17:13 sebastian Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.14.2.3 2008/02/21 02:56:57 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -584,7 +584,10 @@ zval**dest_element; php_socket *php_sock; HashTable *new_hash; + char*key; int num = 0; + ulong num_key; + uintkey_len; if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0; @@ -599,7 +602,14 @@ 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); + switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(sock_array), key, key_len, num_key, 0, NULL)) { + case HASH_KEY_IS_STRING: + zend_hash_add(new_hash, key, key_len, (void *)element, sizeof(zval *), (void **)dest_element); + break; + case HASH_KEY_IS_LONG: + zend_hash_index_update(new_hash, num_key, (void *)element, sizeof(zval *), (void **)dest_element); + break; + } if (dest_element) zval_add_ref(dest_element); } num++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php