prioritize partials once they reach a certain threshold, to keep them from growing

This commit is contained in:
Arvid Norberg 2008-09-22 00:41:36 +00:00
parent 1ac3b8298c
commit ca4ab436d0
1 changed files with 3 additions and 0 deletions

View File

@ -1304,6 +1304,9 @@ namespace libtorrent
, int prefer_whole_pieces, void* peer, piece_state_t speed
, int options, std::vector<int> const& suggested_pieces) const
{
// prevent the number of partial pieces to grow indefinitely
if (m_downloads.size() > 20) options |= prioritize_partials;
// only one of rarest_first and sequential can be set.
TORRENT_ASSERT(bool(options & rarest_first)
+ bool(options & sequential) <= 1);