Changeset 12379


Ignore:
Timestamp:
Apr 24, 2011, 10:56:42 PM (11 years ago)
Author:
jordan
Message:

(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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r12335 r12379  
    25842584
    25852585    desiredAvailable = 0;
    2586     for( i=0, n=tor->info.pieceCount; i<n; ++i )
    2587     {
    2588         if( tor->info.pieces[i].dnd )
    2589             continue;
    2590         if( t->pieceReplicationSize >= i )
    2591             continue;
    2592         if( t->pieceReplication[i] == 0 )
    2593             continue;
    2594 
    2595         desiredAvailable += tr_cpMissingBytesInPiece( &t->tor->completion, i );
    2596     }
     2586    for( i=0, n=MIN(tor->info.pieceCount, t->pieceReplicationSize); i<n; ++i )
     2587        if( !tor->info.pieces[i].dnd && ( t->pieceReplication[i] > 0 ) )
     2588            desiredAvailable += tr_cpMissingBytesInPiece( &t->tor->completion, i );
    25972589
    25982590    return desiredAvailable;
Note: See TracChangeset for help on using the changeset viewer.