From: Matt Joiner Date: Sat, 23 Aug 2014 17:10:47 +0000 (+1000) Subject: Count posted cancels X-Git-Tag: v1.0.0~1609 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b72b05f49561391bdcdfa990a53f141008d08299;p=btrtrc.git Count posted cancels --- 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