diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index bf42994865..9f20d04b29 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -228,7 +228,7 @@ void uv_loop_delete(uv_loop_t* loop) { static unsigned int uv__poll_timeout(uv_loop_t* loop) { - if (!uv__has_active_handles(loop)) + if (!uv__has_active_handles(loop) && !uv__has_active_reqs(loop)) return 0; if (!ngx_queue_empty(&loop->idle_handles)) diff --git a/deps/uv/src/unix/internal.h b/deps/uv/src/unix/internal.h index 382c272235..dd46c95ed5 100644 --- a/deps/uv/src/unix/internal.h +++ b/deps/uv/src/unix/internal.h @@ -93,8 +93,7 @@ enum { UV_STREAM_WRITABLE = 0x40, /* The stream is writable */ UV_STREAM_BLOCKING = 0x80, /* Synchronous writes. */ UV_TCP_NODELAY = 0x100, /* Disable Nagle. */ - UV_TCP_KEEPALIVE = 0x200, /* Turn on keep-alive. */ - UV_TCP_CONNECTING = 0x400 /* Not alway set. See uv_connect() in tcp.c */ + UV_TCP_KEEPALIVE = 0x200 /* Turn on keep-alive. */ }; inline static void uv__req_init(uv_loop_t* loop, diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c index bab65807be..284643e4a3 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -787,12 +787,6 @@ static void uv__stream_connect(uv_stream_t* stream) { stream->connect_req = NULL; uv__req_unregister(stream->loop, req); - /* Hack. See uv__connect() in tcp.c */ - if (stream->flags & UV_TCP_CONNECTING) { - assert(stream->type == UV_TCP); - uv__handle_stop(stream); - } - if (req->cb) { uv__set_sys_error(stream->loop, error); req->cb(req, error ? -1 : 0); diff --git a/deps/uv/src/unix/tcp.c b/deps/uv/src/unix/tcp.c index 1aeba0efcf..233be82514 100644 --- a/deps/uv/src/unix/tcp.c +++ b/deps/uv/src/unix/tcp.c @@ -109,17 +109,8 @@ static int uv__connect(uv_connect_t* req, while (r == -1 && errno == EINTR); if (r == -1) { - if (errno == EINPROGRESS) { - /* Not an error. However, we need to keep the event loop from spinning - * while the connection is in progress. Artificially start the handle - * and stop it again in uv__stream_connect() in stream.c. Yes, it's a - * hack but there's no good alternative, the v0.8 ABI is frozen. - */ - if (!uv__is_active(handle)) { - handle->flags |= UV_TCP_CONNECTING; - uv__handle_start(handle); - } - } + if (errno == EINPROGRESS) + ; /* not an error */ else if (errno == ECONNREFUSED) /* If we get a ECONNREFUSED wait until the next tick to report the * error. Solaris wants to report immediately--other unixes want to