diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 57a2ef53d..e5a606ee6 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -2366,25 +2366,18 @@ tr_torrentPieceNeedsCheck( const tr_torrent * tor, tr_piece_index_t p ) const tr_info * inf = tr_torrentInfo( tor ); /* if we've never checked this piece, then it needs to be checked */ - if( !inf->pieces[p].timeChecked ) { - tr_tordbg( tor, "[LAZY] piece %zu needs to be tested because it's never been tested", (size_t)p ); + if( !inf->pieces[p].timeChecked ) return TRUE; - } /* If we think we've completed one of the files in this piece, * but it's been modified since we last checked it, * then it needs to be rechecked */ tr_ioFindFileLocation( tor, p, 0, &f, &unused ); - for( ; f < inf->fileCount && pieceHasFile( p, &inf->files[f] ); ++f ) { - if( tr_cpFileIsComplete( &tor->completion, f ) ) { - if( getFileMTime( tor, f ) > inf->pieces[p].timeChecked ) { - tr_tordbg( tor, "[LAZY] piece %zu needs to be tested because file %zu mtime is newer than check time %zu", (size_t)p, (size_t)f, (size_t)inf->pieces[p].timeChecked ); + for( ; f < inf->fileCount && pieceHasFile( p, &inf->files[f] ); ++f ) + if( tr_cpFileIsComplete( &tor->completion, f ) ) + if( getFileMTime( tor, f ) > inf->pieces[p].timeChecked ) return TRUE; - } - } - } - tr_tordbg( tor, "[LAZY] piece %zu does not need to be tested", (size_t)p ); return FALSE; } diff --git a/libtransmission/verify.c b/libtransmission/verify.c index 94886c1e2..2f7c773f6 100644 --- a/libtransmission/verify.c +++ b/libtransmission/verify.c @@ -55,7 +55,7 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag ) SHA1_Init( &sha ); - tr_tordbg( tor, "%s", "[LAZY] verifying torrent..." ); + tr_tordbg( tor, "%s", "verifying torrent..." ); tr_torrentSetChecked( tor, 0 ); while( !*stopFlag && ( pieceIndex < tor->info.pieceCount ) ) { @@ -139,7 +139,6 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag ) filePos = 0; } } - tr_tordbg( tor, "%s", "[LAZY] DONE verifying torrent..." ); /* cleanup */ if( fd >= 0 ) @@ -148,7 +147,7 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag ) /* stopwatch */ end = tr_time( ); - tr_tordbg( tor, "it took %d seconds to verify %"PRIu64" bytes (%"PRIu64" bytes per second)", + tr_tordbg( tor, "Verification is done. It took %d seconds to verify %"PRIu64" bytes (%"PRIu64" bytes per second)", (int)(end-begin), tor->info.totalSize, (uint64_t)(tor->info.totalSize/(1+(end-begin))) );