From 9a79d1e6033f4843bc6b323a492b48feff014242 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 8 Oct 2007 01:53:11 +0000 Subject: [PATCH] the purge flag should take priority over all the other reasons to keep or purge a peer. :p --- libtransmission/peer-mgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index b435d31d8..2c8bba27d 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1047,9 +1047,9 @@ tr_peerMgrSetBlame( tr_peerMgr * manager, if( peer->strikes < MAX_BAD_PIECES_PER_PEER ) continue; - peer->doPurge = 1; atom = getExistingAtom( t, &peer->in_addr ); atom->myflags |= MYFLAG_BANNED; + peer->doPurge = 1; tordbg( t, "banning peer %s due to corrupt data", tr_peerIoAddrStr(&atom->addr,atom->port) ); } } @@ -1510,10 +1510,10 @@ getWeakConnections( Torrent * t, int * setmeSize ) assert( atom != NULL ); - if( throughput >= 3 ) - isWeak = FALSE; - else if( peer->doPurge ) + if( peer->doPurge ) isWeak = TRUE; + else if( throughput >= 3 ) + isWeak = FALSE; else if( peerIsSeed && clientIsSeed ) isWeak = t->tor->pexDisabled || (now-atom->time>=30); else if( ( now - atom->time ) < LAISSEZ_FAIRE_PERIOD_SECS )