Changeset 4885
- Timestamp:
- Feb 1, 2008, 1:38:57 AM (14 years ago)
- Location:
- branches/1.0x/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0x/libtransmission/fastresume.c
r4854 r4885 209 209 /* Write progress data */ 210 210 if (1) { 211 int n;211 int i, n; 212 212 tr_time_t * mtimes; 213 213 uint8_t * buf = malloc( FR_PROGRESS_LEN( tor ) ); … … 217 217 /* mtimes */ 218 218 mtimes = getMTimes( tor, &n ); 219 for( i=0; i<n; ++i ) 220 if( !tr_torrentIsFileChecked( tor, i ) ) 221 mtimes[i] = ~(tr_time_t)0; /* force a recheck next time */ 219 222 memcpy( walk, mtimes, n*sizeof(tr_time_t) ); 220 223 walk += n * sizeof(tr_time_t); … … 419 422 if ( curMTimes[i] == mtime ) 420 423 tr_torrentSetFileChecked( tor, i, TRUE ); 421 else 424 else { 425 tr_torrentSetFileChecked( tor, i, FALSE ); 422 426 tr_dbg( "File '%s' recheck needed", tor->info.files[i].name ); 427 } 423 428 } 424 429 free( curMTimes ); -
branches/1.0x/libtransmission/torrent.c
r4859 r4885 1294 1294 } 1295 1295 1296 int 1297 tr_torrentIsFileChecked( const tr_torrent * tor, int fileIndex ) 1298 { 1299 const tr_file * file = &tor->info.files[fileIndex]; 1300 const size_t begin = file->firstPiece; 1301 const size_t end = file->lastPiece + 1; 1302 size_t i; 1303 int isChecked = TRUE; 1304 1305 for( i=begin; isChecked && i<end; ++i ) 1306 if( !tr_torrentIsPieceChecked( tor, i ) ) 1307 isChecked = FALSE; 1308 1309 return isChecked; 1310 } 1311 1296 1312 void 1297 1313 tr_torrentUncheck( tr_torrent * tor ) -
branches/1.0x/libtransmission/torrent.h
r4854 r4885 85 85 int tr_torrentCountUncheckedPieces( const tr_torrent * ); 86 86 int tr_torrentIsPieceChecked ( const tr_torrent *, int piece ); 87 int tr_torrentIsFileChecked ( const tr_torrent *, int file ); 87 88 void tr_torrentSetPieceChecked ( tr_torrent *, int piece, int isChecked ); 88 89 void tr_torrentSetFileChecked ( tr_torrent *, int file, int isChecked );
Note: See TracChangeset
for help on using the changeset viewer.