From 06d8142c5b350279d349d45e71d826596074ef55 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 4 Feb 2011 06:55:05 +0000 Subject: [PATCH] checking torrents don't count in auto manage logic --- src/session_impl.cpp | 10 ++++++++++ src/torrent.cpp | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index cdc6fee55..c30779821 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -3150,6 +3150,11 @@ namespace aux { , end(list.end()); i != end; ++i) { torrent* t = *i; + + if ((t->state() == torrent_status::checking_files + || t->state() == torrent_status::queued_for_checking)) + continue; + if (!t->is_paused() && !is_active(t, settings()) && hard_limit > 0) { @@ -3210,6 +3215,11 @@ namespace aux { { torrent* t = i->second.get(); TORRENT_ASSERT(t); + + // checking torrents are not subject to auto-management + if (t->state() == torrent_status::checking_files + || t->state() == torrent_status::queued_for_checking) + continue; if (t->is_auto_managed() && !t->has_error()) { // this torrent is auto managed, add it to diff --git a/src/torrent.cpp b/src/torrent.cpp index cb21a194e..1874662a7 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -1611,6 +1611,9 @@ namespace libtorrent if (ret == piece_manager::need_full_check) return; dequeue_torrent_check(); + // calling pause will also trigger the auto managed + // recalculation + if (m_auto_managed) pause(); files_checked(); }