From f17cb1bf50c8e1aec4905062f7e3fdf886e09533 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 9 Jun 2016 15:34:13 +0100 Subject: [PATCH] Fix retry of Windows wsaend errors #442 Make the test for wsaend error less specific --- fs/closed_conn_win.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/closed_conn_win.go b/fs/closed_conn_win.go index 6c843aace..488d22f7a 100644 --- a/fs/closed_conn_win.go +++ b/fs/closed_conn_win.go @@ -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 {