aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2016-09-10 14:04:46 +1000
committerAlex Brainman <alex.brainman@gmail.com>2016-09-11 01:42:30 +0000
commitfca3dd3718080563f4bc6c4c8b6fbe681a1602fa (patch)
tree13bedd5bf2cd388a559979e88be5b532fdda06ae /src/syscall
parentf15915af4effbbe6895ae69be02d22ac016927d5 (diff)
downloadgo-fca3dd3718080563f4bc6c4c8b6fbe681a1602fa.tar.xz
syscall: avoid convT2I allocs for ERROR_IO_PENDING instead of WSAEINPROGRESS
CL 28484 mistakenly assumed that WSARecv returns WSAEINPROGRESS when there is nothing to read. But the error is ERROR_IO_PENDING. Fix that mistake. I was about to write a test for it. But I have found TestTCPReadWriteAllocs in net package that does nearly what I need, but was conveniently disabled. So enable and extend the test. Fixes #16988 Change-Id: I55e5cf8998a9cf29e92b398d702280bdf7d6fc85 Reviewed-on: https://go-review.googlesource.com/28990 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/mksyscall_windows.go10
-rw-r--r--src/syscall/zsyscall_windows.go10
2 files changed, 6 insertions, 14 deletions
diff --git a/src/syscall/mksyscall_windows.go b/src/syscall/mksyscall_windows.go
index a39f3c3635..fcc847616c 100644
--- a/src/syscall/mksyscall_windows.go
+++ b/src/syscall/mksyscall_windows.go
@@ -831,12 +831,8 @@ var _ unsafe.Pointer
// Do the interface allocations only once for common
// Errno values.
-const (
- errnoWSAEINPROGRESS = 10036
-)
-
var (
- errWSAEINPROGRESS error = {{syscalldot}}Errno(errnoWSAEINPROGRESS)
+ errERROR_IO_PENDING error = {{syscalldot}}Errno(ERROR_IO_PENDING)
)
// errnoErr returns common boxed Errno values, to prevent
@@ -845,8 +841,8 @@ func errnoErr(e {{syscalldot}}Errno) error {
switch e {
case 0:
return nil
- case errnoWSAEINPROGRESS:
- return errWSAEINPROGRESS
+ case ERROR_IO_PENDING:
+ return errERROR_IO_PENDING
}
// TODO: add more here, after collecting data on the common
// error values see on Windows. (perhaps when running
diff --git a/src/syscall/zsyscall_windows.go b/src/syscall/zsyscall_windows.go
index 7e23552625..c99e3cf532 100644
--- a/src/syscall/zsyscall_windows.go
+++ b/src/syscall/zsyscall_windows.go
@@ -11,12 +11,8 @@ var _ unsafe.Pointer
// Do the interface allocations only once for common
// Errno values.
-const (
- errnoWSAEINPROGRESS = 10036
-)
-
var (
- errWSAEINPROGRESS error = Errno(errnoWSAEINPROGRESS)
+ errERROR_IO_PENDING error = Errno(ERROR_IO_PENDING)
)
// errnoErr returns common boxed Errno values, to prevent
@@ -25,8 +21,8 @@ func errnoErr(e Errno) error {
switch e {
case 0:
return nil
- case errnoWSAEINPROGRESS:
- return errWSAEINPROGRESS
+ case ERROR_IO_PENDING:
+ return errERROR_IO_PENDING
}
// TODO: add more here, after collecting data on the common
// error values see on Windows. (perhaps when running