p2p/net/conn: timeouts are real failures.
Juan Batiz-Benet committed
Jan 23, 2015 at 05:24 UTC
5c33b75b59bc40ff7f2ab11223dc6d0366904d55
1 file changed
+5
p2p/net/conn/dial.go
+5
@@ -147,6 +147,11 @@ func reuseErrShouldRetry(err error) bool {
147
return false // hey, it worked! no need to retry.
148
}
149
150
+ // if it's a network timeout error, it's a legitimate failure.
151
+ if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
152
+ return true
153
+ }
154
+
155
errno, ok := err.(syscall.Errno)
156
if !ok { // not an errno? who knows what this is. retry.
157
return true