From d70ec645d7753e15b91212301f194c8a648620ef Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 17 Jun 2008 15:44:04 +0000 Subject: [PATCH] Make 'active_seeds' and 'active_downloads' use -1 as unlimited --- docs/manual.rst | 2 +- src/session_impl.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/manual.rst b/docs/manual.rst index f6e02006e..9dab5fb53 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -3026,7 +3026,7 @@ the *QBone scavenger service*. For more details, see QBSS_. downloading torrents the queuing mechanism allows. The target number of active torrents is ``max(active_downloads, active_seeds)``. ``active_downloads`` and ``active_seeds`` are upper limits on the number of downloading torrents and -seeding torrents respectively. +seeding torrents respectively. Setting the value to -1 will mean unlimited. For example if there are 10 seeding torrents and 10 downloading torrents, and ``active_downloads`` is 4 and ``active_seeds`` is 4, there will be no seed diff --git a/src/session_impl.cpp b/src/session_impl.cpp index a5fd1a50f..e12075129 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1308,6 +1308,11 @@ namespace aux { int num_downloaders = settings().active_downloads; int num_seeds = settings().active_seeds; + if (num_downloaders == -1) + num_downloaders = (std::numeric_limits::max)(); + if (num_seeds == -1) + num_seeds = (std::numeric_limits::max)(); + for (torrent_map::iterator i = m_torrents.begin() , end(m_torrents.end()); i != end; ++i) {