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
func isClosedConnErrorPlatform(err error) bool {
if oe, ok := err.(*net.OpError); ok && oe.Op == "read" {
if se, ok := oe.Err.(*os.SyscallError); ok && se.Syscall == "wsarecv" {
if oe, ok := err.(*net.OpError); ok {
if se, ok := oe.Err.(*os.SyscallError); ok {
if errno, ok := se.Err.(syscall.Errno); ok {
const WSAECONNABORTED syscall.Errno = 10053
if errno == syscall.WSAECONNRESET || errno == WSAECONNABORTED {