Re: cvs: php4 /ext/sockets sockets.c
| From: | Markus Fischer | Date: | Wed, 01 May 2002 06:41:14 +0000 |
| Subject: | Re: cvs: php4 /ext/sockets sockets.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-11579@lists.php.net to get a copy of this message | ||
Hi,
can we expect getting this into 4.2.1 ? This would really be
very important because people will get bitten by it in the
future horrible. It is one of the last major changes in the
API.
- Markus
On Wed, May 01, 2002 at 04:47:00AM -0000, Jason Greene wrote :
> jason Wed May 1 00:47:00 2002 EDT
>
> Modified files:
> /php4/ext/sockets sockets.c
> Log:
> Changed socket_select to force reference copy, the older code would modify all references
> @Fixed a bug in socket_select() that could cause unexpected behavior when using a statement
> @ like $w=$e=array($sock);
> @This change unfortunately prevents the use of constant values(NULL) for the socket array
> paramaters.
> @Instead use a temporary variable or an expression with the leftmost member being a temporary
> variable.
> @ ex. socket_select($w, $r, $e=NULL, 10);
>
> Also fix small memory leak.
>
>
> Index: php4/ext/sockets/sockets.c
> diff -u php4/ext/sockets/sockets.c:1.102 php4/ext/sockets/sockets.c:1.103
> --- php4/ext/sockets/sockets.c:1.102 Tue Apr 30 18:03:51 2002
> +++ php4/ext/sockets/sockets.c Wed May 1 00:46:59 2002
> @@ -19,7 +19,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: sockets.c,v 1.102 2002/04/30 22:03:51 mfischer Exp $ */
> +/* $Id: sockets.c,v 1.103 2002/05/01 04:46:59 jason Exp $ */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
> @@ -94,6 +94,9 @@
> static int le_socket;
> #define le_socket_name "Socket"
>
> +static unsigned char first_through_third_args_force_ref[] =
> +{3, BYREF_FORCE, BYREF_FORCE, BYREF_FORCE};
> +
> static unsigned char second_and_third_args_force_ref[] =
> {3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE};
>
> @@ -115,7 +118,7 @@
> PHP_FE(socket_iovec_fetch, NULL)
> PHP_FE(socket_iovec_add, NULL)
> PHP_FE(socket_iovec_delete, NULL)
> - PHP_FE(socket_select, NULL)
> + PHP_FE(socket_select, first_through_third_args_force_ref)
> PHP_FE(socket_create, NULL)
> PHP_FE(socket_create_listen, NULL)
> PHP_FE(socket_create_pair, NULL)
> @@ -487,6 +490,7 @@
>
> /* Destroy old array, add new one */
> zend_hash_destroy(Z_ARRVAL_P(sock_array));
> + efree(Z_ARRVAL_P(sock_array));
>
> zend_hash_internal_pointer_reset(new_hash);
> Z_ARRVAL_P(sock_array) = new_hash;
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" "What QA did you do on it?" "the usual?" "ah...
none :)"