Force close of socket on unexpected error

r1309 | dcl | 2006-11-21 12:37:02 +1100 (Tue, 21 Nov 2006) | 2 lines
This commit is contained in:
Douglas Clowes
2006-11-21 12:37:02 +11:00
parent 26006fb59b
commit 85d41577b3
2 changed files with 20 additions and 8 deletions

View File

@@ -366,12 +366,18 @@ void sock_input(int n)
}
if (sz < 0)
{
if (errno == EAGAIN) /* AKA EWOULDBLOCK */
switch (errno)
{
case EAGAIN: /* AKA EWOULDBLOCK */
dbg_printf(0, "EAGAIN:");
else if (errno == ESPIPE) /* Illegal seek (on pipe or socket) */
dbg_printf(0, "ESPIPE:");
else
break;
case EINTR:
dbg_printf(0, "EINTR:");
break;
default:
perror("recv");
sock_close(n);
}
return;
}
int i;