Changeset 12109


Ignore:
Timestamp:
Mar 7, 2011, 3:46:26 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) finish r12108

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bitset.c

    r12096 r12109  
    160160}
    161161
    162 /* return true if "b" is equal to, or a superset of, "set" */
    163 tr_bool
    164 tr_bitsetHasSet( const tr_bitset * b, const tr_bitset * set )
    165 {
    166     const uint8_t * bit = b->bitfield.bits;
    167     const uint8_t * bend = bit + b->bitfield.byteCount;
    168     const uint8_t * sit = set->bitfield.bits;
    169     const uint8_t * send = sit + set->bitfield.byteCount;
    170 
    171     if( b->haveAll || set->haveAll )
    172         return b->haveAll;
    173 
    174     if( b->haveNone || set->haveNone )
    175         return set->haveNone;
    176 
    177     for( ; bit!=bend && sit!=send; ++bit, ++sit )
    178         if( ( *bit & *sit ) != *sit )
    179             return FALSE;
    180 
    181     return TRUE;
    182 }
    183 
    184162double
    185163tr_bitsetPercent( const tr_bitset * b )
  • trunk/libtransmission/bitset.h

    r12019 r12109  
    5555
    5656tr_bool tr_bitsetHas( const tr_bitset * b, const size_t nth );
    57 tr_bool tr_bitsetHasSet( const tr_bitset * b, const tr_bitset * compare );
    5857size_t tr_bitsetCountRange( const tr_bitset * b, const size_t begin, const size_t end );
    5958
  • trunk/libtransmission/peer-mgr.c

    r12108 r12109  
    31353135    }
    31363136
    3137     /* if we're seeding and the peer has everything we have,
    3138      * and enough time has passed for a pex exchange, then disconnect */
     3137    /* disconnect if we're both seeds and enough time has passed for PEX */
    31393138    if( tr_torrentIsSeed( tor ) && ( peer->progress >= 1.0f ) )
    31403139        return !tr_torrentAllowsPex(tor) || (now-atom->time>=30);
Note: See TracChangeset for help on using the changeset viewer.