Changeset 8931
- Timestamp:
- Aug 14, 2009, 8:55:22 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/verify.c
r8878 r8931 47 47 tr_bool hadPiece = 0; 48 48 uint32_t piecePos = 0; 49 uint32_t pieceBytesRead = 0; 49 50 tr_file_index_t fileIndex = 0; 50 51 tr_piece_index_t pieceIndex = 0; … … 90 91 if( (fd>=0) && tr_lseek( fd, filePos, SEEK_SET ) != -1 ) { 91 92 const int64_t numRead = read( fd, buffer, bytesThisPass ); 93 if( numRead > 0 ) 94 pieceBytesRead += numRead; 92 95 if( numRead == bytesThisPass ) 93 96 SHA1_Update( &sha, buffer, numRead ); … … 121 124 tor->anyDate = time( NULL ); 122 125 126 /* going full-throttle on a verify can choke other processes' 127 * disk IO, so wait a fwe msec between pieces. 128 * The msec is arbitrary, and the "if" clause is to make sure we 129 * don't slow down verification of files that don't exist */ 130 if( pieceBytesRead == tr_torPieceCountBytes( tor, pieceIndex ) ) 131 tr_wait( 50 ); 132 123 133 SHA1_Init( &sha ); 124 134 ++pieceIndex; 125 135 piecePos = 0; 136 pieceBytesRead = 0; 126 137 } 127 138
Note: See TracChangeset
for help on using the changeset viewer.