Use generic message routine for sim_accept_conn and sim_read_sock and don't emit a message if a read fails due to ECONNRESET (this is expected).
This commit is contained in:
parent
d01b070dcf
commit
0b1fe53943
1 changed files with 4 additions and 3 deletions
|
@ -869,7 +869,7 @@ newsock = accept (master, (struct sockaddr *) &clientname, &size);
|
||||||
if (newsock == INVALID_SOCKET) { /* error? */
|
if (newsock == INVALID_SOCKET) { /* error? */
|
||||||
err = WSAGetLastError ();
|
err = WSAGetLastError ();
|
||||||
if (err != WSAEWOULDBLOCK)
|
if (err != WSAEWOULDBLOCK)
|
||||||
printf ("Sockets: accept error %d\n", err);
|
sim_err_sock(newsock, "accept", 0);
|
||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
if (connectaddr != NULL) {
|
if (connectaddr != NULL) {
|
||||||
|
@ -945,8 +945,9 @@ if (rbytes == SOCKET_ERROR) {
|
||||||
#endif
|
#endif
|
||||||
if ((err != WSAETIMEDOUT) && /* expected errors after a connect failure */
|
if ((err != WSAETIMEDOUT) && /* expected errors after a connect failure */
|
||||||
(err != WSAEHOSTUNREACH) &&
|
(err != WSAEHOSTUNREACH) &&
|
||||||
(err != WSAECONNREFUSED))
|
(err != WSAECONNREFUSED) &&
|
||||||
printf ("Sockets: read error %d\n", err);
|
(err != WSAECONNRESET))
|
||||||
|
sim_err_sock (INVALID_SOCKET, "read", 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return rbytes;
|
return rbytes;
|
||||||
|
|
Loading…
Add table
Reference in a new issue