fix graceful pause issue

This commit is contained in:
arvidn 2016-06-04 21:34:00 -04:00
parent b3942a08fa
commit 8baf4f810a
2 changed files with 6 additions and 7 deletions

View File

@ -240,7 +240,7 @@ namespace libtorrent
// set to true when this torrent has been paused but
// is waiting to finish all current download requests
// before actually closing all connections, When in graceful pause mode,
// before actually closing all connections, when in graceful pause mode,
// m_paused is also true.
bool m_graceful_pause_mode:1;
@ -480,7 +480,7 @@ namespace libtorrent
int seeding_time() const;
bool is_paused() const;
bool is_torrent_paused() const { return m_paused || m_graceful_pause_mode; }
bool is_torrent_paused() const { return m_paused; }
void force_recheck();
void save_resume_data(int flags);

View File

@ -8722,7 +8722,7 @@ namespace libtorrent
INVARIANT_CHECK;
if (m_auto_managed == a) return;
bool checking_files = should_check_files();
bool const checking_files = should_check_files();
m_auto_managed = a;
update_gauge();
update_want_scrape();
@ -8940,7 +8940,6 @@ namespace libtorrent
&& !m_paused
&& !has_error()
&& !m_abort
&& !m_graceful_pause_mode
&& !m_session_paused;
}
@ -8972,7 +8971,7 @@ namespace libtorrent
bool torrent::is_paused() const
{
return m_paused || m_session_paused || m_graceful_pause_mode;
return m_paused || m_session_paused;
}
void torrent::pause(bool graceful)
@ -9193,6 +9192,8 @@ namespace libtorrent
m_paused = b;
// the session may still be paused, in which case
// the effective state of the torrent did not change
if (paused_before == is_paused()) return;
m_graceful_pause_mode = (flags & flag_graceful_pause) ? true : false;
@ -9222,8 +9223,6 @@ namespace libtorrent
// we need to save this new state
set_need_save_resume();
update_want_scrape();
do_resume();
}