Fix failure to request data from peers if it goes missing after being downloaded during the same session

The chunks remained marked dirty, even after the piece was marked complete. So when the piece was not complete, there was nothing to do.
This commit is contained in:
Matt Joiner 2016-02-22 03:23:49 +11:00
parent fd37f5c24b
commit c371502cb3
1 changed files with 1 additions and 0 deletions

View File

@ -2435,6 +2435,7 @@ func (me *Client) pieceHashed(t *torrent, piece int, correct bool) {
func (me *Client) onCompletedPiece(t *torrent, piece int) {
t.pendingPieces.Remove(piece)
t.pendAllChunkSpecs(piece)
for _, conn := range t.Conns {
conn.Have(piece)
for r := range conn.Requests {