mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-26 03:00:55 +00:00
Reset wset even if not connecting asynchronously
This commit is contained in:
parent
6d4cdfaab7
commit
21566cac78
1 changed files with 5 additions and 3 deletions
|
@ -374,6 +374,9 @@ static INT32 MS_Connect(const char *ip_addr, const char *str_port, INT32 async)
|
||||||
if (!I_InitTcpDriver()) // this is done only if not already done
|
if (!I_InitTcpDriver()) // this is done only if not already done
|
||||||
return MS_SOCKET_ERROR;
|
return MS_SOCKET_ERROR;
|
||||||
|
|
||||||
|
FD_ZERO(&wset);
|
||||||
|
select_timeout.tv_sec = 0, select_timeout.tv_usec = 0;
|
||||||
|
|
||||||
gaie = I_getaddrinfo(ip_addr, str_port, &hints, &ai);
|
gaie = I_getaddrinfo(ip_addr, str_port, &hints, &ai);
|
||||||
if (gaie != 0)
|
if (gaie != 0)
|
||||||
return MS_GETHOSTBYNAME_ERROR;
|
return MS_GETHOSTBYNAME_ERROR;
|
||||||
|
@ -385,6 +388,8 @@ static INT32 MS_Connect(const char *ip_addr, const char *str_port, INT32 async)
|
||||||
socket_fd = socket(runp->ai_family, runp->ai_socktype, runp->ai_protocol);
|
socket_fd = socket(runp->ai_family, runp->ai_socktype, runp->ai_protocol);
|
||||||
if (socket_fd != (SOCKET_TYPE)ERRSOCKET)
|
if (socket_fd != (SOCKET_TYPE)ERRSOCKET)
|
||||||
{
|
{
|
||||||
|
FD_SET(socket_fd, &wset);
|
||||||
|
|
||||||
if (async) // do asynchronous connection
|
if (async) // do asynchronous connection
|
||||||
{
|
{
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
|
@ -412,9 +417,6 @@ static INT32 MS_Connect(const char *ip_addr, const char *str_port, INT32 async)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
con_state = MSCS_WAITING;
|
con_state = MSCS_WAITING;
|
||||||
FD_ZERO(&wset);
|
|
||||||
FD_SET(socket_fd, &wset);
|
|
||||||
select_timeout.tv_sec = 0, select_timeout.tv_usec = 0;
|
|
||||||
I_freeaddrinfo(ai);
|
I_freeaddrinfo(ai);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue