mirror of
https://github.com/simh/simh.git
synced 2026-03-02 17:55:17 +00:00
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:
@@ -869,7 +869,7 @@ newsock = accept (master, (struct sockaddr *) &clientname, &size);
|
||||
if (newsock == INVALID_SOCKET) { /* error? */
|
||||
err = WSAGetLastError ();
|
||||
if (err != WSAEWOULDBLOCK)
|
||||
printf ("Sockets: accept error %d\n", err);
|
||||
sim_err_sock(newsock, "accept", 0);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
if (connectaddr != NULL) {
|
||||
@@ -945,8 +945,9 @@ if (rbytes == SOCKET_ERROR) {
|
||||
#endif
|
||||
if ((err != WSAETIMEDOUT) && /* expected errors after a connect failure */
|
||||
(err != WSAEHOSTUNREACH) &&
|
||||
(err != WSAECONNREFUSED))
|
||||
printf ("Sockets: read error %d\n", err);
|
||||
(err != WSAECONNREFUSED) &&
|
||||
(err != WSAECONNRESET))
|
||||
sim_err_sock (INVALID_SOCKET, "read", 0);
|
||||
return -1;
|
||||
}
|
||||
return rbytes;
|
||||
|
||||
Reference in New Issue
Block a user