]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Count posted cancels
authorMatt Joiner <anacrolix@gmail.com>
Sat, 23 Aug 2014 17:10:47 +0000 (03:10 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 23 Aug 2014 17:10:47 +0000 (03:10 +1000)
client.go

index 7a11c24a79371eb18a7f9a0295baf0f220f02643..2a20b263385c0b802bd7b26e3708f45b8b777581 100644 (file)
--- 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