p2p/net/conn: timeouts are real failures.

This commit is contained in:
Juan Batiz-Benet 2015-01-23 05:24:23 -08:00
parent bdda7ff6b6
commit b20f767eb4
1 changed files with 5 additions and 0 deletions

View File

@ -147,6 +147,11 @@ func reuseErrShouldRetry(err error) bool {
return false // hey, it worked! no need to retry.
}
// if it's a network timeout error, it's a legitimate failure.
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
return true
}
errno, ok := err.(syscall.Errno)
if !ok { // not an errno? who knows what this is. retry.
return true