From 11d703fbf138caf5b6437f3c0c7c9e2239b95ec6 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 17 Sep 2015 12:50:29 +1000 Subject: [PATCH] Count failed chunk sends against a connection --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 16782a9c..5caaf76a 100644 --- a/client.go +++ b/client.go @@ -1448,6 +1448,8 @@ another: } func (me *Client) sendChunk(t *torrent, c *connection, r request) error { + // Count the chunk being sent, even if it isn't. + c.chunksSent++ b := make([]byte, r.Length) tp := t.Pieces[r.Index] tp.pendingWritesMutex.Lock() @@ -1470,7 +1472,6 @@ func (me *Client) sendChunk(t *torrent, c *connection, r request) error { Piece: b, }) uploadChunksPosted.Add(1) - c.chunksSent++ c.lastChunkSent = time.Now() return nil } -- 2.48.1