From: Harald Radi Date: Sat, 15 Jun 2002 15:58:16 +0000 (+0000) Subject: workaround for a win32 memleak X-Git-Tag: php5_5_0~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7bdde218eb0b2a187e88944bc3c43ecef7a5041;p=php workaround for a win32 memleak # this definitely has to be revisited ! # maybe we should use winsock2 and overlapped IO --- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 015cc099c4..c4a9319595 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -56,7 +56,6 @@ # define set_errno(a) (errno = a) # define set_h_errno(a) (h_errno = a) #else /* windows */ -# include # include "php_sockets.h" # include "php_sockets_win.h" # define IS_INVALID_SOCKET(a) (a->bsd_socket == INVALID_SOCKET) @@ -755,6 +754,8 @@ PHP_FUNCTION(socket_read) 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) {