windows: freeze in uv_tcp_endgame
The event_handle field of unused accept requests was not being initialized properly. As a result, uv_tcp_endgame would try to close an invalid handle and this could lead to unexpected behavior. This fixes node.js test test-cluster-disconnect.js on Windows.
This commit is contained in:
parent
6e2021ca11
commit
4f913b669a
@ -577,6 +577,7 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
|
||||
req->accept_socket = INVALID_SOCKET;
|
||||
req->data = handle;
|
||||
req->wait_handle = INVALID_HANDLE_VALUE;
|
||||
req->event_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1040,9 +1041,11 @@ void uv_process_tcp_write_req(uv_loop_t* loop, uv_tcp_t* handle,
|
||||
if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
|
||||
if (req->wait_handle != INVALID_HANDLE_VALUE) {
|
||||
UnregisterWait(req->wait_handle);
|
||||
req->wait_handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
if (req->event_handle) {
|
||||
CloseHandle(req->event_handle);
|
||||
req->event_handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user