Ignore:
Timestamp:
Oct 28, 2007, 7:42:46 PM (15 years ago)
Author:
charles
Message:

#426 0.91rc1: if pex is disabled on a stopped torrent, pressing "resume" causes pex to be re-enabled. (reported by pea)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9x/libtransmission/fastresume.c

    r3573 r3618  
    524524
    525525static uint64_t
     526internalIdToPublicBitfield( uint8_t id )
     527{
     528    uint64_t ret = 0;
     529
     530    switch( id )
     531    {
     532        case FR_ID_PROGRESS_SLOTS: ret = 0;                 break;
     533        case FR_ID_DOWNLOADED:     ret = TR_FR_DOWNLOADED;  break;
     534        case FR_ID_UPLOADED:       ret = TR_FR_UPLOADED;    break;
     535        case FR_ID_PEERS_OLD:      ret = TR_FR_PEERS;       break;
     536        case FR_ID_PROGRESS:       ret = TR_FR_PROGRESS;    break;
     537        case FR_ID_PRIORITY:       ret = TR_FR_PRIORITY;    break;
     538        case FR_ID_SPEED:          ret = TR_FR_SPEEDLIMIT;  break;
     539        case FR_ID_RUN:            ret = TR_FR_RUN;         break;
     540        case FR_ID_CORRUPT:        ret = TR_FR_CORRUPT;     break;
     541        case FR_ID_PEERS:          ret = TR_FR_PEERS;       break;
     542        case FR_ID_DESTINATION:    ret = TR_FR_DESTINATION; break;
     543        case FR_ID_PEX:            ret = TR_FR_PEX;         break;
     544    }
     545
     546    return ret;
     547}
     548
     549static uint64_t
    526550fastResumeLoadImpl ( tr_torrent   * tor,
     551                     uint64_t       fieldsToLoad,
    527552                     tr_bitfield  * uncheckedPieces,
    528553                     const char   * destination,
     
    575600    while( 1 == fread( &id, 1, 1, file ) && 1 == fread( &len, 4, 1, file ) )
    576601    {
    577         switch( id )
     602        if( fieldsToLoad & internalIdToPublicBitfield( id ) ) switch( id )
    578603        {
    579604            case FR_ID_PROGRESS:
     
    774799uint64_t
    775800tr_fastResumeLoad( tr_torrent   * tor,
     801                   uint64_t       fieldsToLoad,
    776802                   tr_bitfield  * uncheckedPieces,
    777803                   const char   * destination,
    778804                   int            argIsFallback )
    779805{
    780     const uint64_t ret = fastResumeLoadImpl( tor, uncheckedPieces, destination, argIsFallback );
     806    const uint64_t ret = fastResumeLoadImpl( tor, fieldsToLoad, uncheckedPieces, destination, argIsFallback );
    781807
    782808    if( ! ( ret & TR_FR_PROGRESS ) )
Note: See TracChangeset for help on using the changeset viewer.