From b72b05f49561391bdcdfa990a53f141008d08299 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 24 Aug 2014 03:10:47 +1000 Subject: [PATCH] Count posted cancels --- client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.go b/client.go index 7a11c24a..2a20b263 100644 --- a/client.go +++ b/client.go @@ -49,6 +49,7 @@ var ( peersFoundByPEX = expvar.NewInt("peersFoundByPEX") uploadChunksPosted = expvar.NewInt("uploadChunksPosted") unexpectedCancels = expvar.NewInt("unexpectedCancels") + postedCancels = expvar.NewInt("postedCancels") ) const extensionBytes = "\x00\x00\x00\x00\x00\x10\x00\x00" @@ -541,6 +542,7 @@ func (me *Client) peerUnchoked(torrent *torrent, conn *connection) { func (cl *Client) connCancel(t *torrent, cn *connection, r request) (ok bool) { ok = cn.Cancel(r) if ok { + postedCancels.Add(1) cl.downloadStrategy.DeleteRequest(t, r) } return -- 2.48.1