p2p/net/swarm: half the timeout of dial
Juan Batiz-Benet committed
Jan 22, 2015 at 19:32 UTC
0821a5bd53772f44deb7623a6c34655068fb92d0
1 file changed
+3
p2p/net/conn/dial.go
+3
@@ -115,6 +115,9 @@ func (d *Dialer) reuseDial(laddr, raddr ma.Multiaddr) (conn net.Conn, retry bool
115
return nil, true, reuseport.ErrReuseFailed
116
}
117
118
+ // half the timeout so we can retry regularly if this fails.
119
+ d.Dialer.Dialer.Timeout = (d.Dialer.Dialer.Timeout / 2)
120
+
121
// give reuse.Dialer the manet.Dialer's Dialer.
122
// (wow, Dialer should've so been an interface...)
123
rd := reuseport.Dialer{d.Dialer.Dialer}