improve seed rank calculation

This commit is contained in:
Arvid Norberg 2012-01-23 01:57:40 +00:00
parent 5fc9224072
commit dce8b3cc1a
1 changed files with 7 additions and 7 deletions

View File

@ -6613,16 +6613,16 @@ namespace libtorrent
TORRENT_ASSERT(m_ses.is_network_thread()); TORRENT_ASSERT(m_ses.is_network_thread());
enum flags enum flags
{ {
seed_ratio_not_met = 0x400000, seed_ratio_not_met = 0x40000000,
recently_started = 0x200000, no_seeds = 0x20000000,
no_seeds = 0x100000, recently_started = 0x10000000,
prio_mask = 0xfffff prio_mask = 0x0fffffff
}; };
if (!is_finished()) return 0; if (!is_finished()) return 0;
int scale = 100; int scale = 1000;
if (!is_seed()) scale = 50; if (!is_seed()) scale = 500;
int ret = 0; int ret = 0;
@ -6665,7 +6665,7 @@ namespace libtorrent
} }
else else
{ {
ret |= (downloaders * scale / seeds) & prio_mask; ret |= ((1 + downloaders) * scale / seeds) & prio_mask;
} }
return ret; return ret;