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/torrent.c

    r12503 r12531  
    12621262    tr_torrentUnlock( tor );
    12631263
     1264    /* test some of the constraints */
     1265    assert( s->sizeWhenDone <= tor->info.totalSize );
     1266    assert( s->leftUntilDone <= s->sizeWhenDone );
     1267    assert( s->desiredAvailable <= s->leftUntilDone );
    12641268    return s;
    12651269}
Note: See TracChangeset for help on using the changeset viewer.