Changeset 11310 for trunk/libtransmission/inout.c
- Timestamp:
- Oct 14, 2010, 4:21:14 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/inout.c
r11273 r11310 168 168 169 169 static int 170 compareOffsetToFile( const void * a, 171 const void * b ) 170 compareOffsetToFile( const void * a, const void * b ) 172 171 { 173 172 const uint64_t offset = *(const uint64_t*)a; … … 189 188 const tr_file * file; 190 189 190 assert( tr_isTorrent( tor ) ); 191 assert( offset < tor->info.totalSize ); 192 191 193 file = bsearch( &offset, 192 194 tor->info.files, tor->info.fileCount, sizeof( tr_file ), 193 195 compareOffsetToFile ); 196 197 if( file == NULL ) { 198 unsigned int i; 199 fprintf( stderr, "%s", "transmission error\n" ); 200 fprintf( stderr, "pieceIndex %d\n", (int)pieceIndex ); 201 fprintf( stderr, "pieceOffset %d\n", (int)pieceOffset ); 202 fprintf( stderr, "couldn't find file matching offset %"PRIu64"\n", offset ); 203 fprintf( stderr, "total torrent size %"PRIu64"\n", tor->info.totalSize ); 204 fprintf( stderr, "%u files\n", (unsigned int)tor->info.fileCount ); 205 for( i=0; i<tor->info.fileCount; ++i ) fprintf( stderr, "file #%u offset %"PRIu64" length %"PRIu64"\n", i, tor->info.files[i].offset, tor->info.files[i].length ); 206 } 207 208 assert( file != NULL ); 194 209 195 210 *fileIndex = file - tor->info.files;
Note: See TracChangeset
for help on using the changeset viewer.