2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Wake connections that could send a request for a deleted piece

I'm not sure this is entirely correct, but not doing it is probably less correct. It should help prevent stalls where writers aren't requesting because they're starved out of opportunities by other connections.
This commit is contained in:
Matt Joiner 2018-07-17 21:29:54 +10:00
parent 6d6197b0a1
commit d575877a5d

View File

@ -1483,8 +1483,11 @@ func (c *connection) deleteRequest(r request) bool {
panic(n)
}
c.updateRequests()
// TODO: Other connections that aren't interested, and can provide this
// chunk might be wakeable?
for _c := range c.t.conns {
if !_c.Interested && _c != c && c.PeerHasPiece(pieceIndex(r.Index)) {
_c.updateRequests()
}
}
return true
}