Ignore:
Timestamp:
Oct 31, 2007, 4:23:51 AM (14 years ago)
Author:
charles
Message:

"corruption" fix part 2: lots of assertions, and try to complete pieces & ban bad peers sooner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r3178 r3663  
    138138tr_cpPieceIsComplete( const tr_completion * cp, int piece )
    139139{
    140     return cp->completeBlocks[piece] >= tr_torPieceCountBlocks(cp->tor,piece);
     140    assert( piece >= 0 );
     141    assert( piece < cp->tor->info.pieceCount );
     142    assert( cp->completeBlocks[piece] <= tr_torPieceCountBlocks(cp->tor,piece) );
     143
     144    return cp->completeBlocks[piece] == tr_torPieceCountBlocks(cp->tor,piece);
    141145}
    142146
Note: See TracChangeset for help on using the changeset viewer.