From 7e430d5a2a04977e8e8bf95e43af92683dd8a26d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 23 Sep 2009 18:44:21 +0000 Subject: [PATCH] resume data alerts are always posted, regardless of alert mask --- ChangeLog | 1 + docs/manual.rst | 3 +++ src/torrent.cpp | 24 ++++++++---------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5dbeacfa6..e5a75c11b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -75,6 +75,7 @@ release 0.14.7 * fixed deadlock in natpmp + * resume data alerts are always posted, regardless of alert mask release 0.14.6 diff --git a/docs/manual.rst b/docs/manual.rst index ad0fc09ac..d6459a96a 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -934,6 +934,9 @@ can be called and it can pop the alert independently. If this limit is reached, new incoming alerts can not be received until alerts are popped by calling ``pop_alert``. Default value is 1000. +``save_resume_data_alert`` and ``save_resume_data_failed_alert`` are always posted, regardelss +of the alert mask. + add_extension() --------------- diff --git a/src/torrent.cpp b/src/torrent.cpp index de43c7eb7..0146e893c 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2331,13 +2331,11 @@ namespace libtorrent { session_impl::mutex_t::scoped_lock l(m_ses.m_mutex); - if (!j.resume_data && alerts().should_post()) + if (!j.resume_data) { alerts().post_alert(save_resume_data_failed_alert(get_handle(), j.error)); - return; } - - if (j.resume_data && alerts().should_post()) + else { write_resume_data(*j.resume_data); alerts().post_alert(save_resume_data_alert(j.resume_data @@ -4933,11 +4931,8 @@ namespace libtorrent if (!m_owning_storage.get()) { - if (alerts().should_post()) - { - alerts().post_alert(save_resume_data_failed_alert(get_handle() - , error_code(errors::destructing_torrent, libtorrent_category))); - } + alerts().post_alert(save_resume_data_failed_alert(get_handle() + , error_code(errors::destructing_torrent, libtorrent_category))); return; } @@ -4946,13 +4941,10 @@ namespace libtorrent || m_state == torrent_status::checking_files || m_state == torrent_status::checking_resume_data) { - if (alerts().should_post()) - { - boost::shared_ptr rd(new entry); - write_resume_data(*rd); - alerts().post_alert(save_resume_data_alert(rd - , get_handle())); - } + boost::shared_ptr rd(new entry); + write_resume_data(*rd); + alerts().post_alert(save_resume_data_alert(rd + , get_handle())); return; } m_storage->async_save_resume_data(