send one last state update when a paused torrent's rates reach zero (#2436)

This commit is contained in:
Steven Siloti 2017-10-11 14:10:40 -07:00 committed by Arvid Norberg
parent f19cca1374
commit 2b72a7321a
2 changed files with 7 additions and 3 deletions

View File

@ -17,6 +17,8 @@
* don't attempt to create empty files on startup, if they already exist
* fix force-recheck issue (new files would not be picked up)
* fix inconsistency in file_priorities and override_resume_data behavior
* fix paused torrents not generating a state update when their ul/dl rate
transitions to zero
1.1.4 release

View File

@ -10402,11 +10402,13 @@ namespace {
if (is_paused() && !m_graceful_pause_mode)
{
// let the stats fade out to 0
m_stat.second_tick(tick_interval_ms);
// if the rate is 0, there's no update because of network transfers
// check the rate before ticking the stats so that the last update is sent
// with the rate equal to zero
if (m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0)
state_updated();
else
m_stat.second_tick(tick_interval_ms);
// if the rate is 0, there's no update because of network transfers
if (!(m_stat.low_pass_upload_rate() > 0 || m_stat.low_pass_download_rate() > 0))
update_want_tick();
return;