fix checking behavior when pausing/resuming the session

This commit is contained in:
Arvid Norberg 2011-06-05 03:06:34 +00:00
parent 4a914852cc
commit df003ef57c
2 changed files with 5 additions and 5 deletions

View File

@ -834,6 +834,9 @@ namespace libtorrent
void set_apply_ip_filter(bool b);
bool apply_ip_filter() const { return m_apply_ip_filter; }
void queue_torrent_check();
void dequeue_torrent_check();
private:
void on_files_deleted(int ret, disk_io_job const& j);
@ -857,9 +860,6 @@ namespace libtorrent
void update_peer_interest(bool was_finished);
void prioritize_udp_trackers();
void queue_torrent_check();
void dequeue_torrent_check();
void parse_response(const entry& e, std::vector<peer_entry>& peer_list);
void update_tracker_timer(ptime now);

View File

@ -1397,8 +1397,8 @@ namespace aux {
{
torrent& t = *i->second;
t.do_resume();
if (t.should_check_files()) t.queue_torrent_check();
}
if (!m_queued_for_checking.empty()) m_queued_for_checking.front()->start_checking();
}
void session_impl::abort()
@ -2717,7 +2717,7 @@ namespace aux {
// waiting to be checked. I have never seen this, and I can't
// see a way for it to happen. But, if it does, start one of
// the queued torrents
if (num_checking == 0 && num_queued > 0)
if (num_checking == 0 && num_queued > 0 && !m_paused)
{
TORRENT_ASSERT(false);
check_queue_t::iterator i = std::min_element(m_queued_for_checking.begin()