Ignore:
Timestamp:
Jul 26, 2007, 7:15:36 PM (14 years ago)
Author:
charles
Message:

fix bug in tr_cpDownloadedValid() that caused download sizes of > 4 GiB to be misreported locally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r2488 r2506  
    319319tr_cpDownloadedValid( const tr_completion_t * cp )
    320320{
    321     const tr_torrent_t * tor = cp->tor;
    322 
    323     uint64_t b = tr_bitfieldCountTrueBits( cp->blockBitfield ) * tor->blockSize;
     321    uint64_t b = 0;
     322    const tr_torrent_t * tor = cp->tor;
     323    const tr_info_t * info = &tor->info;
     324    int i;
     325
     326    for( i=0; i<info->pieceCount; ++i )
     327        if( tr_cpPieceIsComplete( cp, i ) )
     328            ++b;
     329
     330    b *= tor->blockSize;
    324331
    325332    if( tor->blockCount && tr_bitfieldHas( cp->blockBitfield, tor->blockCount - 1 ) )
Note: See TracChangeset for help on using the changeset viewer.