From 86d5ad4b2c182513da7a81911da8f67ec1c9a94b Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 23 Apr 2020 12:36:19 +1000 Subject: [PATCH] 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. --- peerconn.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.48.1