#endif
len = recv(fd, trash.str, trash.size, MSG_DONTWAIT | MSG_NOSIGNAL);
- if (len == 0) /* cool, shutdown received */
+ if (len == 0) {
+ /* cool, shutdown received */
+ fdtab[fd].linger_risk = 0;
return 1;
+ }
if (len < 0) {
if (errno == EAGAIN) /* connection not closed yet */
if (errno == EINTR) /* oops, try again */
continue;
/* other errors indicate a dead connection, fine. */
+ fdtab[fd].linger_risk = 0;
return 1;
}
/* OK we read some data, let's try again once */
/* Write error on the file descriptor. Report it to the connection
* and disable polling on this FD.
*/
-
+ fdtab[fd].linger_risk = 0;
conn->flags |= CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH;
__conn_sock_stop_both(conn);
return 0;