Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
win/tcp: don't enable iocp sync bypass when iocp emulation is used
Browse files Browse the repository at this point in the history
When iocp sync bypass is in use libuv doesn't expect the system to
generate events when an i/o operation completes synchronously. However
when iocp emulation is enabled an event will always be generated because
SetFileCompletionNotificationModes() doesn't stop OVERLAPPED.hEvent from
becoming signaled.

This should fix nodejs/node-v0.x-archive#4959.
  • Loading branch information
piscisaureus committed Mar 9, 2013
1 parent f59dc22 commit 5462dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/win/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ static int uv_tcp_set_socket(uv_loop_t* loop, uv_tcp_t* handle,
non_ifs_lsp = uv_tcp_non_ifs_lsp_ipv4;
}

if (pSetFileCompletionNotificationModes && !non_ifs_lsp) {
if (pSetFileCompletionNotificationModes &&
!(handle->flags & UV_HANDLE_EMULATE_IOCP) && !non_ifs_lsp) {
if (pSetFileCompletionNotificationModes((HANDLE) socket,
FILE_SKIP_SET_EVENT_ON_HANDLE |
FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
Expand Down

0 comments on commit 5462dab

Please sign in to comment.