1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 14:10:34 +00:00

(trunk libT) #4204 "Availability is the same as the amount downloaded when there are no seeders" -- possible fix

It looks like we had the wrong test on the replication count array size.
This commit is contained in:
Jordan Lee 2011-04-24 22:56:42 +00:00
parent decbfef106
commit 0d31a32d41

View file

@ -2583,17 +2583,9 @@ tr_peerMgrGetDesiredAvailable( const tr_torrent * tor )
/* do it the hard way */
desiredAvailable = 0;
for( i=0, n=tor->info.pieceCount; i<n; ++i )
{
if( tor->info.pieces[i].dnd )
continue;
if( t->pieceReplicationSize >= i )
continue;
if( t->pieceReplication[i] == 0 )
continue;
desiredAvailable += tr_cpMissingBytesInPiece( &t->tor->completion, i );
}
for( i=0, n=MIN(tor->info.pieceCount, t->pieceReplicationSize); i<n; ++i )
if( !tor->info.pieces[i].dnd && ( t->pieceReplication[i] > 0 ) )
desiredAvailable += tr_cpMissingBytesInPiece( &t->tor->completion, i );
return desiredAvailable;
}