Remove premature update to piece priority after piece is completed
This should have prevented Torrent.piecePriorityChanged from being called, meaning requests for the completed piece were not canceled, and the piece remained in connection's piece request queue, which meant wasted effort downloading chunks for an already acquired piece. Thanks to @elgatito for discovering the issue.
This commit is contained in:
parent
e08d11a4b9
commit
de928be582
|
@ -1515,7 +1515,6 @@ func (t *Torrent) cancelRequestsForPiece(piece int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Torrent) onPieceCompleted(piece int) {
|
func (t *Torrent) onPieceCompleted(piece int) {
|
||||||
t.pendingPieces.Remove(piece)
|
|
||||||
t.pendAllChunkSpecs(piece)
|
t.pendAllChunkSpecs(piece)
|
||||||
t.cancelRequestsForPiece(piece)
|
t.cancelRequestsForPiece(piece)
|
||||||
for conn := range t.conns {
|
for conn := range t.conns {
|
||||||
|
|
Loading…
Reference in New Issue