From c9c9d805dae321a7bdf0077547c2da2dbe70f2a2 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 21 Mar 2012 07:07:18 -0700 Subject: [PATCH] unix: ignore ECONNABORTED errors from accept() 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. --- src/unix/stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/stream.c b/src/unix/stream.c index 966750ef..fd24caaa 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -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);