Make 'active_seeds' and 'active_downloads' use -1 as unlimited

This commit is contained in:
Andrew Resch 2008-06-17 15:44:04 +00:00
parent 24b24aff4e
commit d70ec645d7
2 changed files with 6 additions and 1 deletions

View File

@ -3026,7 +3026,7 @@ the *QBone scavenger service*. For more details, see QBSS_.
downloading torrents the queuing mechanism allows. The target number of active downloading torrents the queuing mechanism allows. The target number of active
torrents is ``max(active_downloads, active_seeds)``. ``active_downloads`` and torrents is ``max(active_downloads, active_seeds)``. ``active_downloads`` and
``active_seeds`` are upper limits on the number of downloading torrents 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 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 ``active_downloads`` is 4 and ``active_seeds`` is 4, there will be no seed

View File

@ -1308,6 +1308,11 @@ namespace aux {
int num_downloaders = settings().active_downloads; int num_downloaders = settings().active_downloads;
int num_seeds = settings().active_seeds; int num_seeds = settings().active_seeds;
if (num_downloaders == -1)
num_downloaders = (std::numeric_limits<int>::max)();
if (num_seeds == -1)
num_seeds = (std::numeric_limits<int>::max)();
for (torrent_map::iterator i = m_torrents.begin() for (torrent_map::iterator i = m_torrents.begin()
, end(m_torrents.end()); i != end; ++i) , end(m_torrents.end()); i != end; ++i)
{ {