win, pipe: null-initialize stream->shutdown_req

When initializing a stream on Windows, this also inits the
shutdown_req field, instead of waiting for a successful
connection. A NULL value is used as a sentinel to check for whether
this handle is currently in the shutdown state, and it may not get
set if a stream was not connected immediately.

PR-URL: https://github.com/libuv/libuv/pull/1500
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
This commit is contained in:
Jameson Nash 2015-07-17 22:21:54 -04:00 committed by cjihrig
parent 7a93b12f1d
commit 6445cc6308
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -36,6 +36,7 @@ INLINE static void uv_stream_init(uv_loop_t* loop,
uv__handle_init(loop, (uv_handle_t*) handle, type);
handle->write_queue_size = 0;
handle->activecnt = 0;
handle->stream.conn.shutdown_req = NULL;
}
@ -47,8 +48,6 @@ INLINE static void uv_connection_init(uv_stream_t* handle) {
handle->read_req.event_handle = NULL;
handle->read_req.wait_handle = INVALID_HANDLE_VALUE;
handle->read_req.data = handle;
handle->stream.conn.shutdown_req = NULL;
}