diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2017-10-11 18:23:30 +1100 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2017-10-25 20:23:32 +0000 |
commit | 7e7cb30475d69bfbaaa8c7519c551f9bd243a756 (patch) | |
tree | 136962632f063a3a6939d3e39f21a00699905e02 | |
parent | f259aed0822dd42182b297740e3c5dcd09e40a84 (diff) | |
download | go-7e7cb30475d69bfbaaa8c7519c551f9bd243a756.tar.gz go-7e7cb30475d69bfbaaa8c7519c551f9bd243a756.zip |
[release-branch.go1.9] internal/poll: only call SetFileCompletionNotificationModes for sockets
CL 36799 made SetFileCompletionNotificationModes to be called for
file handles. I don't think it is correct. Revert that change.
Fixes #22024
Fixes #22207
Change-Id: I26260e8a727131cffbf60958d79eca2457495554
Reviewed-on: https://go-review.googlesource.com/69871
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/70990
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
-rw-r--r-- | src/internal/poll/fd_windows.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/poll/fd_windows.go b/src/internal/poll/fd_windows.go index 2927463eee..27fef04be0 100644 --- a/src/internal/poll/fd_windows.go +++ b/src/internal/poll/fd_windows.go @@ -354,12 +354,12 @@ func (fd *FD) Init(net string, pollable bool) (string, error) { if err != nil { return "", err } - if useSetFileCompletionNotificationModes { + if pollable && useSetFileCompletionNotificationModes { // We do not use events, so we can skip them always. flags := uint8(syscall.FILE_SKIP_SET_EVENT_ON_HANDLE) // It's not safe to skip completion notifications for UDP: // http://blogs.technet.com/b/winserverperformance/archive/2008/06/26/designing-applications-for-high-performance-part-iii.aspx - if net == "tcp" || net == "file" { + if net == "tcp" { flags |= syscall.FILE_SKIP_COMPLETION_PORT_ON_SUCCESS } err := syscall.SetFileCompletionNotificationModes(fd.Sysfd, flags) |