From 540d91ed92aa154b9a1b55121ee89ceeef896b97 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 13 Apr 2011 05:07:47 +0000 Subject: [PATCH] - bugfix for recent socket change on windows --- source/shared_lib/sources/platform/posix/socket.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index d637ec718..424506103 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1979,7 +1979,14 @@ Socket *ServerSocket::accept() { if(isIPAddressBlocked(client_host) == true) { if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] BLOCKING connection, newSock = %d client_host [%s]\n",__FILE__,__FUNCTION__,__LINE__,newSock,client_host); - close(newSock); +#ifndef WIN32 + ::close(newSock); + newSock = INVALID_SOCKET; +#else + ::closesocket(newSock); + newSock = -1; +#endif + return NULL; }