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

Commit

Permalink
unix: uv_read_start should fail if UV_CLOSING set
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 23, 2011
1 parent bdd880e commit ce9171d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/uv-unix.c
Expand Up @@ -1255,6 +1255,11 @@ int64_t uv_now() {
int uv_read_start(uv_stream_t* stream, uv_alloc_cb alloc_cb, uv_read_cb read_cb) {
assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE);

if (stream->flags & UV_CLOSING) {
uv_err_new((uv_handle_t*)stream, EINVAL);
return -1;
}

/* The UV_READING flag is irrelevant of the state of the tcp - it just
* expresses the desired state of the user.
*/
Expand Down

0 comments on commit ce9171d

Please sign in to comment.