Skip to content

Commit

Permalink
p2p/net/conn: timeouts are real failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbenet committed Jan 23, 2015
1 parent 4a5f5e2 commit 5c33b75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p2p/net/conn/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c33b75

Please sign in to comment.