From 3b8c0da5a53b47174e173d2cba3c824d307b20c4 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 30 Jun 2012 03:10:08 +0200 Subject: [PATCH] unix: fix busy loop on unexpected tcp message Don't start reading immediately after connecting. If the server sends a message and the client hasn't called uv_read_start() yet, the event loop will busy loop because the pending message keeps waking it up. --- src/unix/stream.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/unix/stream.c b/src/unix/stream.c index 0dbf1d78..bab65807 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -784,9 +784,6 @@ static void uv__stream_connect(uv_stream_t* stream) { if (error == EINPROGRESS) return; - if (error == 0) - uv__io_start(stream->loop, &stream->read_watcher); - stream->connect_req = NULL; uv__req_unregister(stream->loop, req);