Ignore:
Timestamp:
Dec 2, 2008, 5:10:54 PM (13 years ago)
Author:
charles
Message:

(libT) #1549: support fast exensions' "reject" and "have all/none" messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r7231 r7234  
    8484    tr_bool                  peerIdIsSet;
    8585    tr_bool                  extendedProtocolSupported;
     86    tr_bool                  fastExtensionSupported;
    8687
    8788    int                      magicNumber;
     
    235236{
    236237    return ( io != NULL ) && ( io->magicNumber == MAGIC_NUMBER );
     238}
     239
     240static int
     241isFlag( int flag )
     242{
     243    return( ( flag == 0 ) || ( flag == 1 ) );
    237244}
    238245
     
    488495
    489496void
     497tr_peerIoEnableFEXT( tr_peerIo * io,
     498                     int         flag )
     499{
     500    assert( isPeerIo( io ) );
     501    assert( isFlag( flag ) );
     502
     503    dbgmsg( io, "setting FEXT support flag to %d", (flag?1:0) );
     504    io->fastExtensionSupported = flag;
     505}
     506
     507int
     508tr_peerIoSupportsFEXT( const tr_peerIo * io )
     509{
     510    assert( isPeerIo( io ) );
     511
     512    return io->fastExtensionSupported;
     513}
     514
     515/**
     516***
     517**/
     518
     519void
    490520tr_peerIoEnableLTEP( tr_peerIo * io,
    491521                     int         flag )
    492522{
    493523    assert( isPeerIo( io ) );
    494     assert( flag == 0 || flag == 1 );
    495 
     524    assert( isFlag( flag ) );
     525
     526    dbgmsg( io, "setting LTEP support flag to %d", (flag?1:0) );
    496527    io->extendedProtocolSupported = flag;
    497528}
Note: See TracChangeset for help on using the changeset viewer.