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;
}
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 ) )
{
filePos = 0;
}
}
- tr_tordbg( tor, "%s", "[LAZY] DONE verifying torrent..." );
/* cleanup */
if( fd >= 0 )
/* 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))) );