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.
This commit is contained in:
Matt Joiner 2020-04-23 12:36:19 +10:00
parent 12e377e3fe
commit 86d5ad4b2c
1 changed files with 3 additions and 1 deletions

View 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()