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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user