]> granicus.if.org Git - php/commitdiff
workaround for a win32 memleak
authorHarald Radi <phanto@php.net>
Sat, 15 Jun 2002 15:58:16 +0000 (15:58 +0000)
committerHarald Radi <phanto@php.net>
Sat, 15 Jun 2002 15:58:16 +0000 (15:58 +0000)
# this definitely has to be revisited !
# maybe we should use winsock2 and overlapped IO

ext/sockets/sockets.c

index 015cc099c418bcc30ccdf8496e44366496750c8b..c4a9319595211dd28e2e0a64f2e189cd98e49fab 100644 (file)
@@ -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 @@ 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) {