diff --git a/include/uv.h b/include/uv.h index 7e4b52ba..aa64f010 100644 --- a/include/uv.h +++ b/include/uv.h @@ -504,7 +504,7 @@ UV_EXTERN int uv_try_write(uv_stream_t* handle, struct uv_write_s { UV_REQ_FIELDS uv_write_cb cb; - uv_stream_t* send_handle; + uv_stream_t* send_handle; /* TODO: make private and unix-only in v2.x. */ uv_stream_t* handle; UV_WRITE_PRIVATE_FIELDS }; diff --git a/src/win/pipe.c b/src/win/pipe.c index 56b0da7a..cbec89c1 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -1254,6 +1254,7 @@ static int uv_pipe_write_impl(uv_loop_t* loop, UV_REQ_INIT(req, UV_WRITE); req->handle = (uv_stream_t*) handle; + req->send_handle = send_handle; req->cb = cb; req->ipc_header = 0; req->event_handle = NULL; diff --git a/test/test-ipc-send-recv.c b/test/test-ipc-send-recv.c index 917744cb..7a82cb7e 100644 --- a/test/test-ipc-send-recv.c +++ b/test/test-ipc-send-recv.c @@ -149,6 +149,7 @@ static void connect_cb(uv_connect_t* req, int status) { &ctx.send.stream, NULL); ASSERT(r == 0); + ASSERT(ctx.write_req.send_handle == &ctx.send.stream); /* Perform two writes to the same pipe to make sure that on Windows we are * not running into issue 505: @@ -160,6 +161,7 @@ static void connect_cb(uv_connect_t* req, int status) { &ctx.send2.stream, NULL); ASSERT(r == 0); + ASSERT(ctx.write_req2.send_handle == &ctx.send2.stream); r = uv_read_start((uv_stream_t*)&ctx.channel, alloc_cb, recv_cb); ASSERT(r == 0); @@ -344,6 +346,7 @@ static void read_cb(uv_stream_t* handle, &recv->stream, write2_cb); ASSERT(r == 0); + ASSERT(write_req->send_handle == &recv->stream); } while (uv_pipe_pending_count(pipe) > 0); }