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

Commit

Permalink
unix: fix busy loop on unexpected tcp message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bnoordhuis committed Jun 30, 2012
1 parent 1d1dd9b commit 3b8c0da
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/unix/stream.c
Expand Up @@ -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);

Expand Down

0 comments on commit 3b8c0da

Please sign in to comment.