Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: ignore ECONNABORTED errors from accept()
Browse files Browse the repository at this point in the history
ECONNABORTED means that the connection was torn down by the peer before the
TCP handshake completed. Ignore it, there's nothing we can do and it simplifies
error handling for libuv users.
  • Loading branch information
bnoordhuis committed Mar 21, 2012
1 parent 8ce8bfa commit c9c9d80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/unix/stream.c
Expand Up @@ -185,6 +185,9 @@ void uv__server_io(EV_P_ ev_io* watcher, int revents) {
} else if (errno == EMFILE) {
/* TODO special trick. unlock reserved socket, accept, close. */
return;
} else if (errno == ECONNABORTED) {
/* ignore */
continue;
} else {
uv__set_sys_error(stream->loop, errno);
stream->connection_cb((uv_stream_t*)stream, -1);
Expand Down

0 comments on commit c9c9d80

Please sign in to comment.