fix r4425 oops

This commit is contained in:
Charles Kerr 2008-01-02 20:34:20 +00:00
parent 0e56fa0baf
commit 2b7a82b9a8
3 changed files with 7 additions and 3 deletions

View File

@ -432,7 +432,7 @@ parseProgress( tr_torrent * tor,
const uint8_t * walk = buf;
const tr_time_t * oldMTimes = (const tr_time_t *) walk;
for( i=0; i<n; ++i ) {
if ( curMTimes[i] && ( curMTimes[i] == oldMTimes[i] ) ) {
if ( curMTimes[i] == oldMTimes[i] ) {
const tr_file * file = &tor->info.files[i];
tr_dbg( "File '%s' mtimes match -- no recheck needed", file->name );
tr_torrentSetFileChecked( tor, i, TRUE );

View File

@ -395,7 +395,9 @@ void
tr_ioRecheckAdd( tr_torrent * tor,
tr_recheck_done_cb recheck_done_cb )
{
if( tr_torrentCountUncheckedPieces( tor ) == 0 )
const int uncheckedCount = tr_torrentCountUncheckedPieces( tor );
if( !uncheckedCount )
{
/* doesn't need to be checked... */
recheck_done_cb( tor );
@ -404,6 +406,8 @@ tr_ioRecheckAdd( tr_torrent * tor,
{
struct recheck_node * node;
tr_inf( "Queueing %s to verify %d local file pieces", tor->info.name, uncheckedCount );
node = tr_new( struct recheck_node, 1 );
node->torrent = tor;
node->recheck_done_cb = recheck_done_cb;

View File

@ -1299,5 +1299,5 @@ tr_torrentUncheck( tr_torrent * tor )
int
tr_torrentCountUncheckedPieces( const tr_torrent * tor )
{
return tr_bitfieldCountTrueBits( tor->checkedPieces );
return tor->info.pieceCount - tr_bitfieldCountTrueBits( tor->checkedPieces );
}