client.go | 3 ++- diff --git a/client.go b/client.go index 16782a9c4edac074627534d312db7b9e75312561..5caaf76a5d2c23a24112cd5711ee14069af8e16a 100644 --- a/client.go +++ b/client.go @@ -1448,6 +1448,8 @@ c.Choke() } 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 @@ Begin: r.Begin, Piece: b, }) uploadChunksPosted.Add(1) - c.chunksSent++ c.lastChunkSent = time.Now() return nil }