From 6b4d500c3685829cf710d81a973e887496d0f18c Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 7 Mar 2011 03:46:26 +0000 Subject: [PATCH] (trunk libT) finish r12108 --- libtransmission/bitset.c | 22 ---------------------- libtransmission/bitset.h | 1 - libtransmission/peer-mgr.c | 3 +-- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/libtransmission/bitset.c b/libtransmission/bitset.c index 1df932be4..a013556a2 100644 --- a/libtransmission/bitset.c +++ b/libtransmission/bitset.c @@ -159,28 +159,6 @@ tr_bitsetCountRange( const tr_bitset * b, const size_t begin, const size_t end ) return tr_bitfieldCountRange( &b->bitfield, begin, end ); } -/* return true if "b" is equal to, or a superset of, "set" */ -tr_bool -tr_bitsetHasSet( const tr_bitset * b, const tr_bitset * set ) -{ - const uint8_t * bit = b->bitfield.bits; - const uint8_t * bend = bit + b->bitfield.byteCount; - const uint8_t * sit = set->bitfield.bits; - const uint8_t * send = sit + set->bitfield.byteCount; - - if( b->haveAll || set->haveAll ) - return b->haveAll; - - if( b->haveNone || set->haveNone ) - return set->haveNone; - - for( ; bit!=bend && sit!=send; ++bit, ++sit ) - if( ( *bit & *sit ) != *sit ) - return FALSE; - - return TRUE; -} - double tr_bitsetPercent( const tr_bitset * b ) { diff --git a/libtransmission/bitset.h b/libtransmission/bitset.h index 7fbbbf0c8..b4f98a2ec 100644 --- a/libtransmission/bitset.h +++ b/libtransmission/bitset.h @@ -54,7 +54,6 @@ void tr_bitsetToBenc( const tr_bitset * bitset, struct tr_benc * benc ); double tr_bitsetPercent( const tr_bitset * b ); tr_bool tr_bitsetHas( const tr_bitset * b, const size_t nth ); -tr_bool tr_bitsetHasSet( const tr_bitset * b, const tr_bitset * compare ); size_t tr_bitsetCountRange( const tr_bitset * b, const size_t begin, const size_t end ); void tr_bitsetOr( tr_bitfield * a, const tr_bitset * b ); diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 627768388..579ea48bd 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -3134,8 +3134,7 @@ shouldPeerBeClosed( const Torrent * t, return TRUE; } - /* if we're seeding and the peer has everything we have, - * and enough time has passed for a pex exchange, then disconnect */ + /* disconnect if we're both seeds and enough time has passed for PEX */ if( tr_torrentIsSeed( tor ) && ( peer->progress >= 1.0f ) ) return !tr_torrentAllowsPex(tor) || (now-atom->time>=30); -- 2.40.0