Follow Azureus' and uTorrent's lead in not counting corrupt pieces in our announce data, as it could give us a misleadingly bad share ratio . (Ticket #263)

This commit is contained in:
Charles Kerr 2007-07-25 16:50:32 +00:00
parent d259e7b65a
commit 88d4df169b
1 changed files with 7 additions and 0 deletions

View File

@ -350,6 +350,13 @@ static int parsePiece( tr_torrent_t * tor, tr_peer_t * peer,
/* Piece is complete, check it */
if( ( ret = tr_ioHash( tor->io, index ) ) )
{
/* Follow Azureus' and uTorrent's lead in not counting corrupt
pieces in our announce data, as it could give us a misleadingly
bad share ratio . (Ticket #263) */
const int byteCount = tr_pieceSize( index );
if( tor->downloadedCur >= byteCount )
tor->downloadedCur -= byteCount;
return ret;
}
if( !tr_cpPieceIsComplete( tor->completion, index ) )