summaryrefslogtreecommitdiff
path: root/ext/sockets
diff options
context:
space:
mode:
authorHarald Radi <phanto@php.net>2002-06-15 15:58:16 +0000
committerHarald Radi <phanto@php.net>2002-06-15 15:58:16 +0000
commitf7bdde218eb0b2a187e88944bc3c43ecef7a5041 (patch)
treefdab0a58aaeb52169e693c00daf855fceef53a33 /ext/sockets
parentebecbcb995c8344c1ea14f99bfeaad12d382321e (diff)
downloadphp-git-f7bdde218eb0b2a187e88944bc3c43ecef7a5041.tar.gz
workaround for a win32 memleak
# this definitely has to be revisited ! # maybe we should use winsock2 and overlapped IO
Diffstat (limited to 'ext/sockets')
-rw-r--r--ext/sockets/sockets.c3
1 files changed, 2 insertions, 1 deletions
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 <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) {