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

Commit

Permalink
unix: unconditionally stop handle on close
Browse files Browse the repository at this point in the history
Make sure the handle is fully stopped by the time uv__stream_close()
calls uv_read_stop(). Fixes the following assertion:

    Assertion failed: (!uv__io_active(&stream->io_watcher, UV__POLLOUT)
    || !ngx_queue_empty(&stream->write_completed_queue)
    || !ngx_queue_empty(&stream->write_queue)
    || stream->shutdown_req != NULL
    || stream->connect_req != NULL), function uv_read_stop,
    file ../deps/uv/src/unix/stream.c, line 1329.

Fixes nodejs/node-v0.x-archive#5622.
  • Loading branch information
bnoordhuis committed Jun 5, 2013
1 parent e9ae62d commit 8e4b248
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/unix/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,8 +1395,9 @@ void uv__stream_close(uv_stream_t* handle) {
}
#endif /* defined(__APPLE__) */

uv_read_stop(handle);
uv__io_close(handle->loop, &handle->io_watcher);
uv_read_stop(handle);
uv__handle_stop(handle);

close(handle->io_watcher.fd);
handle->io_watcher.fd = -1;
Expand Down

0 comments on commit 8e4b248

Please sign in to comment.