]> Sergey Matveev's repositories - btrtrc.git/commitdiff
When we're choked, just forget the requests, we don't need to delete them individuall...
authorMatt Joiner <anacrolix@gmail.com>
Mon, 8 Feb 2016 10:39:15 +0000 (21:39 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 8 Feb 2016 10:39:15 +0000 (21:39 +1100)
client.go

index 805762f15d8d47ff32e5ab74b2ba1cc655fb9dae..ad5ae2e02ec0d01f83efb07c120e9e23d8e54092 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1403,9 +1403,7 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
                switch msg.Type {
                case pp.Choke:
                        c.PeerChoked = true
-                       for r := range c.Requests {
-                               me.connDeleteRequest(t, c, r)
-                       }
+                       c.Requests = nil
                        // We can then reset our interest.
                        c.updateRequests()
                case pp.Reject: