Changeset 11690


Ignore:
Timestamp:
Jan 16, 2011, 3:47:09 PM (11 years ago)
Author:
jch
Message:

Consolidate both versions of tr_isPex into a single function.

There used to be two versions of tr_isPex; one correct in peer-mgr.c,
and one buggy in resume.c. The buggy version caused us to reject all
peers with non-trivial flags when resuming.

Location:
trunk/libtransmission
Files:
3 edited

Legend:

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

    r11632 r11690  
    17671767}
    17681768
    1769 static tr_bool
    1770 tr_isPex( const tr_pex * pex )
    1771 {
    1772     return pex && tr_isAddress( &pex->addr );
    1773 }
    1774 
    17751769void
    17761770tr_peerMgrAddPex( tr_torrent * tor, uint8_t from,
  • trunk/libtransmission/peer-mgr.h

    r11599 r11690  
    132132tr_peer;
    133133
     134static inline tr_bool
     135tr_isPex( const tr_pex * pex )
     136{
     137    return pex && tr_isAddress( &pex->addr );
     138}
     139
    134140const tr_address * tr_peerAddress( const tr_peer * );
    135141
  • trunk/libtransmission/resume.c

    r11599 r11690  
    104104}
    105105
    106 static tr_bool
    107 tr_isPex( const tr_pex * pex )
    108 {
    109     return tr_isAddress( &pex->addr )
    110         && ( pex->flags & 3 ) == pex->flags;
    111 }
    112 
    113106static int
    114107addPeers( tr_torrent * tor, const uint8_t * buf, int buflen )
Note: See TracChangeset for help on using the changeset viewer.