(trunk libT) #1242 "don't accept duplicate blocks during endgame" -- fixed in trunk for 1.92

This commit is contained in:
Charles Kerr 2010-03-07 17:38:34 +00:00
parent c6a76932b2
commit 6b546e8b4b
1 changed files with 4 additions and 1 deletions

View File

@ -1603,13 +1603,16 @@ clientGotBlock( tr_peermsgs * msgs,
return EMSGSIZE;
}
/* save the block */
dbgmsg( msgs, "got block %u:%u->%u", req->index, req->offset, req->length );
if( !tr_peerMgrDidPeerRequest( msgs->torrent, msgs->peer, block ) ) {
dbgmsg( msgs, "we didn't ask for this message..." );
return 0;
}
if( tr_cpPieceIsComplete( &msgs->torrent->completion, req->index ) ) {
dbgmsg( msgs, "we did ask for this message, but the piece is already complete..." );
return 0;
}
/**
*** Save the block