]> Cypherpunks repositories - gostls13.git/commitdiff
internal/poll: only call SetFileCompletionNotificationModes for sockets
authorAlex Brainman <alex.brainman@gmail.com>
Wed, 11 Oct 2017 07:23:30 +0000 (18:23 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Thu, 12 Oct 2017 07:13:23 +0000 (07:13 +0000)
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>
src/internal/poll/fd_windows.go

index dffbdc0957e86eee5e2a9cf4a6f09ab3cc0a1e20..67a4c506f52135ec2b8203c1eba848fca1de47ea 100644 (file)
@@ -357,12 +357,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)