From 4ca695c090f3a7a9e7b5667bc6d069914f7fc34f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 14 Dec 2010 18:36:31 +0000 Subject: [PATCH] (trunk libT) #3656 "endgame could be faster" -- revert the test code from r11528 --- libtransmission/peer-mgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 2474dcd8b..4056920ee 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1093,8 +1093,9 @@ tr_peerMgrGetNextRequests( tr_torrent * tor, { struct weighted_piece * p = pieces + i; const int missing = tr_cpMissingBlocksInPiece( &tor->completion, p->index ); + const int maxDuplicatesPerBlock = endgame ? 3 : 1; - if( !endgame && ( p->requestCount > missing ) ) + if( p->requestCount > ( missing * maxDuplicatesPerBlock ) ) continue; /* if the peer has this piece that we want... */ @@ -1114,7 +1115,7 @@ tr_peerMgrGetNextRequests( tr_torrent * tor, continue; /* don't send the same request to any peer too many times */ - if( !endgame && countBlockRequests( t, b ) ) + if( countBlockRequests( t, b ) >= maxDuplicatesPerBlock ) continue; /* update the caller's table */