Changeset 13105


Ignore:
Timestamp:
Dec 10, 2011, 6:42:52 PM (10 years ago)
Author:
jordan
Message:

(trunk libT) #4644 "Transmission can't download big files from webseed." -- fix overflow error with a patch based on one from and_cesbo. (Modified by Jordan to add random bugs.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/webseed.c

    r12860 r13105  
    482482
    483483        const tr_info * inf = tr_torrentInfo( tor );
    484         const uint32_t remain = t->length - t->blocks_done * tor->blockSize
     484        const uint64_t remain = t->length - t->blocks_done * tor->blockSize
    485485                                - evbuffer_get_length( t->content );
    486486
    487         const uint64_t total_offset = inf->pieceSize * t->piece_index
    488                                     + t->piece_offset + t->length - remain;
     487        const uint64_t total_offset = tr_pieceOffset( tor, t->piece_index,
     488                                                           t->piece_offset,
     489                                                           t->length - remain );
    489490        const tr_piece_index_t step_piece = total_offset / inf->pieceSize;
    490         const uint32_t step_piece_offset
     491        const uint64_t step_piece_offset
    491492                               = total_offset - ( inf->pieceSize * step_piece );
    492493
    493494        tr_file_index_t file_index;
     495        const tr_file * file;
    494496        uint64_t file_offset;
    495         const tr_file * file;
    496         uint32_t this_pass;
     497        uint64_t this_pass;
    497498
    498499        tr_ioFindFileLocation( tor, step_piece, step_piece_offset,
Note: See TracChangeset for help on using the changeset viewer.