Permalink
Browse files

unix: return UV_UNKNOWN_HANDLE when read2 doesn't recv one

unix passes ipc test on this comment.
  • Loading branch information...
1 parent cbca726 commit 0d20e0e3438c5f83285beede15a6725fa772138b @ry ry committed Oct 4, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/unix/stream.c
View
@@ -593,7 +593,12 @@ static void uv__read(uv_stream_t* stream) {
}
}
- stream->read2_cb((uv_pipe_t*)stream, nread, buf, UV_TCP);
+
+ if (stream->accepted_fd >= 0) {
+ stream->read2_cb((uv_pipe_t*)stream, nread, buf, UV_TCP);
+ } else {
+ stream->read2_cb((uv_pipe_t*)stream, nread, buf, UV_UNKNOWN_HANDLE);
+ }
}
}
}

0 comments on commit 0d20e0e

Please sign in to comment.