Changeset 3418


Ignore:
Timestamp:
Oct 15, 2007, 4:35:18 PM (14 years ago)
Author:
charles
Message:

save the tr_torrent::pexDisabled flag in fastresume

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fastresume.c

    r3398 r3418  
    107107
    108108    /* destination of the torrent: zero-terminated string */
    109     FR_ID_DESTINATION = 12
     109    FR_ID_DESTINATION = 12,
     110
     111    /* pex flag
     112     * 't' if pex is enabled, 'f' if disabled */
     113    FR_ID_PEX = 13
    110114};
    111115
     
    285289        fastResumeWriteData( FR_ID_SPEED, buf, 1, walk-buf, file );
    286290        tr_free( buf );
     291    }
     292
     293    if( TRUE ) /* FR_ID_PEX */
     294    {
     295        const char flag = tor->pexDisabled ? 'f' : 't';
     296        fastResumeWriteData( FR_ID_PEX, &flag, 1, 1, file );
    287297    }
    288298
     
    644654                    continue;
    645655                }
     656           
     657            case FR_ID_PEX:
     658                {
     659                    char ch;
     660                    if( fread( &ch, 1, 1, file ) != 1 )
     661                    {
     662                        fclose( file );
     663                        return ret;
     664                    }
     665                    tor->pexDisabled = ch!='t';
     666                    ret |= TR_FR_PEX;
     667                    continue;
     668                }
    646669
    647670            case FR_ID_DOWNLOADED:
  • trunk/libtransmission/fastresume.h

    r3398 r3418  
    3939  TR_FR_RUN          = (1<<7),
    4040  TR_FR_DESTINATION  = (1<<8),
     41  TR_FR_PEX          = (1<<9)
    4142};
    4243
Note: See TracChangeset for help on using the changeset viewer.