From 8409a6765bbda8d68cb3f2e48a1ce0a3d4814096 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 111bbc2d..eee4199f 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -182,6 +182,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);