Ignore:
Timestamp:
Jul 2, 2011, 1:20:17 PM (10 years ago)
Author:
jordan
Message:

(trunk libT) #4336 "availablility nonsense" -- fix bug in tr_cpMissingBytesInPiece() introduced last week by r12515 for #4332. Add assertions to the nightly build to watch for regressions of this fix.

The bug was that I fixed #4332's off-by-one improperly in tr_cpMissingBlocksInPiece(). The piece's last block has to be calculated separately because its byte size may be different than the other blocks, The mistake in r12515 was that the last block could wind up being counted twice.

File:
1 edited

Legend:

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

    r12426 r12531  
    25582558}
    25592559
    2560 /* count how many pieces we want that connected peers have */
     2560/* count how many bytes we want that connected peers have */
    25612561uint64_t
    25622562tr_peerMgrGetDesiredAvailable( const tr_torrent * tor )
     
    25952595            desiredAvailable += tr_cpMissingBytesInPiece( &t->tor->completion, i );
    25962596
     2597    assert( desiredAvailable <= tor->info.totalSize );
    25972598    return desiredAvailable;
    25982599}
Note: See TracChangeset for help on using the changeset viewer.