mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
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:
parent
d259e7b65a
commit
88d4df169b
1 changed files with 7 additions and 0 deletions
|
@ -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 ) )
|
||||
|
|
Loading…
Reference in a new issue