From 2b7a82b9a8dc7bd80c6b603e4caa01d37aa9c00b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 2 Jan 2008 20:34:20 +0000 Subject: [PATCH] fix r4425 oops --- libtransmission/fastresume.c | 2 +- libtransmission/inout.c | 6 +++++- libtransmission/torrent.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libtransmission/fastresume.c b/libtransmission/fastresume.c index a8ae0961d..56d135cf7 100644 --- a/libtransmission/fastresume.c +++ b/libtransmission/fastresume.c @@ -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; iinfo.files[i]; tr_dbg( "File '%s' mtimes match -- no recheck needed", file->name ); tr_torrentSetFileChecked( tor, i, TRUE ); diff --git a/libtransmission/inout.c b/libtransmission/inout.c index b64e0b43e..62d397028 100644 --- a/libtransmission/inout.c +++ b/libtransmission/inout.c @@ -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; diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 2666d529f..b70b23157 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -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 ); }