From 79d4967ee699da2d9a2cd70dac6b8991c5da33af Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 12 Dec 2010 23:29:52 +0000 Subject: [PATCH] (trunk libT) #3656 "endgame could be faster" -- another experimental patch, added to trunk for reality testing in the nightly builds. --- libtransmission/peer-mgr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 31ca64c75..b99feca89 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1093,9 +1093,8 @@ 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( p->requestCount > ( missing * maxDuplicatesPerBlock ) ) + if( !endgame && ( p->requestCount > missing ) ) continue; /* if the peer has this piece that we want... */ @@ -1115,7 +1114,7 @@ tr_peerMgrGetNextRequests( tr_torrent * tor, continue; /* don't send the same request to any peer too many times */ - if( countBlockRequests( t, b ) >= maxDuplicatesPerBlock ) + if( !endgame && countBlockRequests( t, b ) ) continue; /* update the caller's table */