Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-02-15 19:45:02 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2012-02-15 19:45:14 +0400
commit0685707bc643250de297b59f4f58878d4c17292e (patch)
treeb09cf89a276be700c55a662627ea30c234b999fa /src/pipe_wrap.cc
parent14b20ffc3006eaebb08840601a1330e5204c290c (diff)
tcp, pipe: don't assert on uv_accept() errors
It's possible for a new connection to be closed in the window between the accept() syscall and the call to uv_accept(). Deal with it and move on, don't assert.
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r--src/pipe_wrap.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 6c3887d84f6..c99fe473976 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -204,10 +204,7 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) {
PipeWrap* client_wrap =
static_cast<PipeWrap*>(client_obj->GetPointerFromInternalField(0));
- int r = uv_accept(handle, (uv_stream_t*)&client_wrap->handle_);
-
- // uv_accept should always work.
- assert(r == 0);
+ if (uv_accept(handle, (uv_stream_t*)&client_wrap->handle_)) return;
// Successful accept. Call the onconnection callback in JavaScript land.
Local<Value> argv[1] = { client_obj };