From dce8b3cc1a4e89faeb679a9c37b5568308d74555 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 23 Jan 2012 01:57:40 +0000 Subject: [PATCH] improve seed rank calculation --- src/torrent.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index fd8a1fb72..05036e08b 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -6613,16 +6613,16 @@ namespace libtorrent TORRENT_ASSERT(m_ses.is_network_thread()); enum flags { - seed_ratio_not_met = 0x400000, - recently_started = 0x200000, - no_seeds = 0x100000, - prio_mask = 0xfffff + seed_ratio_not_met = 0x40000000, + no_seeds = 0x20000000, + recently_started = 0x10000000, + prio_mask = 0x0fffffff }; if (!is_finished()) return 0; - int scale = 100; - if (!is_seed()) scale = 50; + int scale = 1000; + if (!is_seed()) scale = 500; int ret = 0; @@ -6665,7 +6665,7 @@ namespace libtorrent } else { - ret |= (downloaders * scale / seeds) & prio_mask; + ret |= ((1 + downloaders) * scale / seeds) & prio_mask; } return ret;