]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Don't delete requests if we're choked per BEP 6
authorMatt Joiner <anacrolix@gmail.com>
Thu, 23 Apr 2020 02:36:19 +0000 (12:36 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 23 Apr 2020 02:36:19 +0000 (12:36 +1000)
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

index 8933dc77036fa1777ba716e6cef63df1c63ee468..9bb51facd0b38eeacb6e4488100f0a3229ccc2a5 100644 (file)
@@ -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()