Re: cvs: php4 /ext/sockets sockets.c
| From: | Jason T. Greene | Date: | Tue, 18 Jun 2002 13:29:51 +0000 |
| Subject: | Re: cvs: php4 /ext/sockets sockets.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-12406@lists.php.net to get a copy of this message | ||
I am equally surprised that this fix works, though I don't doubt your
discovery. I have a few questions though
What version/sp did you see this leak on?
What SAPI?
Was recv the only call that leaked?
Thanks,
Jason
On Sat, 2002-06-15 at 10:58, Harald Radi wrote:
> phanto Sat Jun 15 11:58:20 2002 EDT
>
> Modified files:
> /php4/ext/sockets sockets.c
> Log:
> workaround for a win32 memleak
> # this definitely has to be revisited !
> # maybe we should use winsock2 and overlapped IO
>
> Index: php4/ext/sockets/sockets.c
> diff -u php4/ext/sockets/sockets.c:1.114 php4/ext/sockets/sockets.c:1.115
> --- php4/ext/sockets/sockets.c:1.114 Sun May 12 03:22:47 2002
> +++ php4/ext/sockets/sockets.c Sat Jun 15 11:58:16 2002
> @@ -19,7 +19,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: sockets.c,v 1.114 2002/05/12 07:22:47 jason Exp $ */
> +/* $Id: sockets.c,v 1.115 2002/06/15 15:58:16 phanto Exp $ */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
> @@ -56,7 +56,6 @@
> # define set_errno(a) (errno = a)
> # define set_h_errno(a) (h_errno = a)
> #else /* windows */
> -# include <winsock.h>
> # include "php_sockets.h"
> # include "php_sockets_win.h"
> # define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET)
> @@ -755,6 +754,8 @@
> retval = (*read_function)(php_sock->bsd_socket, tmpbuf, length);
> #else
> retval = recv(php_sock->bsd_socket, tmpbuf, length, 0);
> + /* i don't know why, but it _does_ fix a memleak */
> + SleepEx(1, TRUE);
> #endif
>
> if (retval == -1) {
>
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>