Fix retry of Windows wsaend errors #442

Make the test for wsaend error less specific
This commit is contained in:
Nick Craig-Wood 2016-06-09 15:34:13 +01:00
parent 9ec06df79f
commit f17cb1bf50

View file

@ -13,8 +13,8 @@ import (
// //
// Code adapted from net/http // Code adapted from net/http
func isClosedConnErrorPlatform(err error) bool { func isClosedConnErrorPlatform(err error) bool {
if oe, ok := err.(*net.OpError); ok && oe.Op == "read" { if oe, ok := err.(*net.OpError); ok {
if se, ok := oe.Err.(*os.SyscallError); ok && se.Syscall == "wsarecv" { if se, ok := oe.Err.(*os.SyscallError); ok {
if errno, ok := se.Err.(syscall.Errno); ok { if errno, ok := se.Err.(syscall.Errno); ok {
const WSAECONNABORTED syscall.Errno = 10053 const WSAECONNABORTED syscall.Errno = 10053
if errno == syscall.WSAECONNRESET || errno == WSAECONNABORTED { if errno == syscall.WSAECONNRESET || errno == WSAECONNABORTED {