SOCKETS: Fixed error suppression when connecting a blocking mode TCP socket
This commit is contained in:
parent
0b015efcac
commit
bc9e79a266
1 changed files with 5 additions and 5 deletions
10
sim_sock.c
10
sim_sock.c
|
@ -1014,11 +1014,11 @@ sta = connect (newsock, result->ai_addr, result->ai_addrlen);
|
|||
p_freeaddrinfo (result);
|
||||
if (sta == SOCKET_ERROR) {
|
||||
if (opt_flags & SIM_SOCK_OPT_BLOCKING) {
|
||||
if ((sta == WSAETIMEDOUT) || /* expected errors after a connect failure */
|
||||
(sta == WSAEHOSTUNREACH) ||
|
||||
(sta == WSAECONNREFUSED) ||
|
||||
(sta == WSAECONNABORTED) ||
|
||||
(sta == WSAECONNRESET)) {
|
||||
if ((WSAGetLastError () == WSAETIMEDOUT) || /* expected errors after a connect failure */
|
||||
(WSAGetLastError () == WSAEHOSTUNREACH) ||
|
||||
(WSAGetLastError () == WSAECONNREFUSED) ||
|
||||
(WSAGetLastError () == WSAECONNABORTED) ||
|
||||
(WSAGetLastError () == WSAECONNRESET)) {
|
||||
sim_close_sock (newsock);
|
||||
newsock = INVALID_SOCKET;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue