made the sequential download mode slightly more sequential (by letting more categories of peers request early pieces). Disabled speed affinity and prefer_whole_pieces when in sequential download mode

This commit is contained in:
Arvid Norberg
2009-01-14 09:07:27 +00:00
parent bd1757fbd2
commit 3f94cc8857
3 changed files with 16 additions and 4 deletions

View File

@@ -1319,6 +1319,12 @@ namespace libtorrent
// peer
// * prioritize_partials
// pick blocks from downloading pieces first
// * speed_affinity
// have an affinity to pick pieces in the same speed
// category.
// * ignore_whole_pieces
// ignores the prefer_whole_pieces parameter (as if
// it was 0)
// only one of rarest_first, sequential can be set
@@ -1330,6 +1336,8 @@ namespace libtorrent
// prevent the number of partial pieces to grow indefinitely
if (m_downloads.size() > 20) options |= prioritize_partials;
if (options & ignore_whole_pieces) prefer_whole_pieces = 0;
// only one of rarest_first and sequential can be set.
TORRENT_ASSERT(bool(options & rarest_first)
+ bool(options & sequential) <= 1);
@@ -1812,7 +1820,7 @@ namespace libtorrent
// if the state of the piece is none (the
// piece will in that case change state).
if (dp.state != none && dp.state != speed
&& !exclusive_active)
&& !exclusive_active && (options & speed_affinity))
{
if (abs(dp.state - speed) == 1)
{