Changeset 11313


Ignore:
Timestamp:
Oct 14, 2010, 7:43:18 PM (11 years ago)
Author:
charles
Message:

(trunk libT) #3631 "crash in tr_ioFindFileLocation" -- possible fix

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r11312 r11313  
    189189
    190190    assert( tr_isTorrent( tor ) );
    191 
    192 if( offset >= tor->info.totalSize )
    193 {
    194 tr_file_index_t i;
    195 fprintf( stderr, "looking for torrent offset is %"PRIu64"\n", offset );
    196 fprintf( stderr, "total torrent size %"PRIu64"\n", tor->info.totalSize );
    197 fprintf( stderr, "pieceIndex %d\n", (int)pieceIndex );
    198 fprintf( stderr, "pieceOffset %d\n", (int)pieceOffset );
    199 fprintf( stderr, "piece size is %d\n", (int)tor->info.pieceSize );
    200 fprintf( stderr, "last piece size is %d\n", (int)tor->lastPieceSize );
    201 fprintf( stderr, "%u files\n", (unsigned int)tor->info.fileCount );
    202 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 );
    203 }
    204 
    205191    assert( offset < tor->info.totalSize );
    206192
  • trunk/libtransmission/peer-msgs.c

    r11299 r11313  
    12141214    {
    12151215        const struct peer_request * req = msgs->peerAskedFor + i;
    1216         tr_cachePrefetchBlock( getSession(msgs)->cache, msgs->torrent, req->index, req->offset, req->length );
    1217         ++msgs->prefetchCount;
     1216        if( requestIsValid( msgs, req ) )
     1217        {
     1218            tr_cachePrefetchBlock( getSession(msgs)->cache, msgs->torrent, req->index, req->offset, req->length );
     1219            ++msgs->prefetchCount;
     1220        }
    12181221    }
    12191222}
Note: See TracChangeset for help on using the changeset viewer.