mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-28 13:57:52 +08:00
p2p/net/conn: timeouts are real failures.
This commit is contained in:
parent
4a5f5e2e2b
commit
5c33b75b59
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user