mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-13 06:12:49 -06:00
*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:
parent
f73d09622b
commit
33ff7807e0
1 changed files with 7 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue