experimental support for the BitTyrant choking algorithm

This commit is contained in:
Arvid Norberg
2010-02-09 03:04:41 +00:00
parent 1a97405189
commit fb47469834
16 changed files with 396 additions and 72 deletions

View File

@@ -57,6 +57,8 @@ namespace libtorrent
for (int j = 0; j < 5 && channel[j]; ++j)
{
if (channel[j]->throttle() == 0) continue;
TORRENT_ASSERT(channel[j]->distribute_quota
< (std::numeric_limits<boost::uint64_t>::max)() / priority);
quota = (std::min)(int(boost::uint64_t(channel[j]->distribute_quota)
* priority / channel[j]->tmp), quota);
}
@@ -65,7 +67,6 @@ namespace libtorrent
channel[j]->use_quota(quota);
TORRENT_ASSERT(assigned <= request_size);
--ttl;
TORRENT_ASSERT(assigned <= request_size);
return quota;
}
}