mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
parent
d976cc65d2
commit
d3b35cba42
1 changed files with 1 additions and 1 deletions
|
|
@ -971,7 +971,7 @@ func (l *flakeyListener) Accept() (net.Conn, error) {
|
||||||
|
|
||||||
c, err := l.Listener.Accept()
|
c, err := l.Listener.Accept()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
timeout := time.Duration(rand.Int63n(int64(l.maxKillTimeout)))
|
timeout := max(time.Millisecond*10, time.Duration(rand.Int63n(int64(l.maxKillTimeout))))
|
||||||
time.AfterFunc(timeout, func() {
|
time.AfterFunc(timeout, func() {
|
||||||
log.Debug(fmt.Sprintf("killing conn %v after %v", c.LocalAddr(), timeout))
|
log.Debug(fmt.Sprintf("killing conn %v after %v", c.LocalAddr(), timeout))
|
||||||
c.Close()
|
c.Close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue