diff --git a/src/piece_picker.cpp b/src/piece_picker.cpp index 35b97b4df..6aeb5fae0 100644 --- a/src/piece_picker.cpp +++ b/src/piece_picker.cpp @@ -1304,6 +1304,9 @@ namespace libtorrent , int prefer_whole_pieces, void* peer, piece_state_t speed , int options, std::vector 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);