1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

fix values for tr_cpLeftUntilComplete(), which were slightly off. (TooMuchTime)

This commit is contained in:
Charles Kerr 2007-07-09 05:20:23 +00:00
parent 7e55e27e7c
commit 8fd06f3687

View file

@ -323,7 +323,7 @@ tr_cpLeftUntilComplete ( const tr_completion_t * cp )
b *= tor->blockSize; b *= tor->blockSize;
if( !tr_cpBlockIsComplete( cp, tor->blockCount - 1 ) ) if( !tr_cpBlockIsComplete( cp, tor->blockCount - 1 ) )
b -= (tor->info.totalSize % tor->blockSize); b -= (tor->blockSize - (tor->info.totalSize % tor->blockSize));
return b; return b;
} }
@ -351,7 +351,7 @@ tr_cpLeftUntilDone ( const tr_completion_t * cp )
i = tor->blockCount - 1; i = tor->blockCount - 1;
if( !tr_cpBlockIsComplete( cp, tor->blockCount-1 ) if( !tr_cpBlockIsComplete( cp, tor->blockCount-1 )
&& info->pieces[info->pieceCount-1].priority != TR_PRI_DND ) && info->pieces[info->pieceCount-1].priority != TR_PRI_DND )
b -= (tor->info.totalSize % tor->blockSize); b -= (tor->blockSize - (tor->info.totalSize % tor->blockSize));
return b; return b;
} }
@ -382,7 +382,7 @@ tr_cpDownloadedValid( const tr_completion_t * cp )
uint64_t b = tr_bitfieldCountTrueBits( cp->blockBitfield ) * tor->blockSize; uint64_t b = tr_bitfieldCountTrueBits( cp->blockBitfield ) * tor->blockSize;
if( tr_bitfieldHas( cp->blockBitfield, tor->blockCount - 1 ) ) if( tr_bitfieldHas( cp->blockBitfield, tor->blockCount - 1 ) )
b -= (tor->info.totalSize % tor->blockSize); b -= (tor->blockSize - (tor->info.totalSize % tor->blockSize));
return b; return b;
} }