From: Matt Joiner Date: Thu, 23 Apr 2020 02:36:19 +0000 (+1000) Subject: Don't delete requests if we're choked per BEP 6 X-Git-Tag: v1.16.0~51 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=86d5ad4b2c182513da7a81911da8f67ec1c9a94b;p=btrtrc.git Don't delete requests if we're choked per BEP 6 This should make the expected receive chunk counts match up more correctly. It doesn't seem to affect tests at the moment, but then we don't verify the expected receive chunk counts are correct either. --- diff --git a/peerconn.go b/peerconn.go index 8933dc77..9bb51fac 100644 --- a/peerconn.go +++ b/peerconn.go @@ -1040,7 +1040,9 @@ func (c *PeerConn) mainReadLoop() (err error) { switch msg.Type { case pp.Choke: c.peerChoking = true - c.deleteAllRequests() + if !c.fastEnabled() { + c.deleteAllRequests() + } // We can then reset our interest. c.updateRequests() c.updateExpectingChunks()