diff --git a/peerconn.go b/peerconn.go index c1b98c2a..e17d2116 100644 --- a/peerconn.go +++ b/peerconn.go @@ -869,7 +869,7 @@ func (cn *PeerConn) wroteBytes(n int64) { cn.allStats(add(n, func(cs *ConnStats) *Count { return &cs.BytesWritten })) } -func (cn *PeerConn) readBytes(n int64) { +func (cn *Peer) readBytes(n int64) { cn.allStats(add(n, func(cs *ConnStats) *Count { return &cs.BytesRead })) } diff --git a/webseed-peer.go b/webseed-peer.go index fb981585..71cdfcb4 100644 --- a/webseed-peer.go +++ b/webseed-peer.go @@ -126,6 +126,7 @@ func (ws *webseedPeer) requestResultHandler(r Request, webseedRequest webseed.Re // sure if we can divine which errors indicate cancellation on our end without hitting the // network though. ws.peer.doChunkReadStats(int64(len(result.Bytes))) + ws.peer.readBytes(int64(len(result.Bytes))) ws.peer.t.cl.lock() defer ws.peer.t.cl.unlock() if result.Err != nil {