diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-04 23:27:37 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-04 23:42:00 +0800 |
commit | 22659a7feaf4e939a33762c3f83b43d8bec757db (patch) | |
tree | 59ae2809af292a79a4f619042ed190b4708d5c2a /p2p/peer.go | |
parent | 6e7e5d5fd56a9a6f73e51239ed6648d76db9650d (diff) | |
download | go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.tar go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.tar.gz go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.tar.bz2 go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.tar.lz go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.tar.xz go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.tar.zst go-tangerine-22659a7feaf4e939a33762c3f83b43d8bec757db.zip |
p2p: restore read/write timeouts
They got lost in the transition to rlpxFrameRW.
Diffstat (limited to 'p2p/peer.go')
-rw-r--r-- | p2p/peer.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/p2p/peer.go b/p2p/peer.go index 025be4ba9..c2c83abfc 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -20,8 +20,8 @@ const ( baseProtocolLength = uint64(16) baseProtocolMaxMsgSize = 10 * 1024 * 1024 - disconnectGracePeriod = 2 * time.Second pingInterval = 15 * time.Second + disconnectGracePeriod = 2 * time.Second ) const ( @@ -176,6 +176,7 @@ func (p *Peer) politeDisconnect(reason DiscReason) { func (p *Peer) readLoop() error { for { + p.conn.SetDeadline(time.Now().Add(frameReadTimeout)) msg, err := p.rw.ReadMsg() if err != nil { return err |