tweak connection points in deficit round-robin of outgoing connection attempts balancing between torrents

This commit is contained in:
Arvid Norberg 2012-02-25 10:57:36 +00:00
parent a849d73602
commit 886364118c
1 changed files with 4 additions and 1 deletions

View File

@ -3341,7 +3341,10 @@ namespace aux {
torrent& t = *m_next_connect_torrent->second;
if (t.want_more_peers())
{
int connect_points = 100;
// 133 is so that the average of downloaders with
// more than average peers and less than average
// peers will end up being 100 (i.e. 133 / 2 = 66)
int connect_points = 133;
// have a bias against torrents with more peers
// than average
if (!t.is_seed() && t.num_peers() > average_peers)