*Web: Fixed critical bug with non-blocking sockets in Linux

git-svn-id: svn://ultimatepp.org/upp/trunk@3051 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-01-20 20:06:29 +00:00
parent f73d09622b
commit 33ff7807e0

View file

@ -20,7 +20,7 @@ enum {
#ifdef PLATFORM_WIN32
IS_BLOCKED = SOCKERR(EWOULDBLOCK),
#else
IS_BLOCKED = SOCKERR(EINPROGRESS),
IS_BLOCKED = SOCKERR(EWOULDBLOCK),
#endif
};
@ -243,7 +243,12 @@ bool Socket::Data::OpenClient(const char *host, int port, bool nodelay, dword *m
return true;
int err = GetLastError();
if(err != IS_BLOCKED) {
#ifdef PLATFORM_WIN32
if(err != SOCKERR(EWOULDBLOCK))
#else
if(err != SOCKERR(EINPROGRESS))
#endif
{
SetSockError(NFormat("connect(%s:%d)", host, port));
SLOG("Socket::Data::OpenClient -> connect error, returning false");
return false;