lt sync 2458
This commit is contained in:
parent
7280465cd5
commit
28aaa5fe3b
|
@ -281,6 +281,7 @@ void natpmp::send_map_request(int i)
|
|||
void natpmp::resend_request(int i, error_code const& e)
|
||||
{
|
||||
if (e) return;
|
||||
if (m_abort) return;
|
||||
|
||||
mutex_t::scoped_lock l(m_mutex);
|
||||
if (m_currently_mapping != i) return;
|
||||
|
|
|
@ -398,6 +398,7 @@ namespace aux {
|
|||
#endif
|
||||
// abort the main thread
|
||||
m_abort = true;
|
||||
m_queued_for_checking.clear();
|
||||
if (m_lsd) m_lsd->close();
|
||||
if (m_upnp) m_upnp->close();
|
||||
if (m_natpmp) m_natpmp->close();
|
||||
|
@ -1802,12 +1803,14 @@ namespace aux {
|
|||
|
||||
void session_impl::check_torrent(boost::shared_ptr<torrent> const& t)
|
||||
{
|
||||
if (m_abort) return;
|
||||
if (m_queued_for_checking.empty()) t->start_checking();
|
||||
m_queued_for_checking.push_back(t);
|
||||
}
|
||||
|
||||
void session_impl::done_checking(boost::shared_ptr<torrent> const& t)
|
||||
{
|
||||
if (m_queued_for_checking.empty()) return;
|
||||
check_queue_t::iterator next_check = m_queued_for_checking.begin();
|
||||
check_queue_t::iterator done = m_queued_for_checking.end();
|
||||
for (check_queue_t::iterator i = m_queued_for_checking.begin()
|
||||
|
|
|
@ -3686,8 +3686,20 @@ namespace libtorrent
|
|||
if (m_owning_storage.get())
|
||||
{
|
||||
TORRENT_ASSERT(m_storage);
|
||||
m_storage->async_save_resume_data(
|
||||
bind(&torrent::on_save_resume_data, shared_from_this(), _1, _2));
|
||||
if (m_state == torrent_status::queued_for_checking
|
||||
|| m_state == torrent_status::checking_files)
|
||||
{
|
||||
if (alerts().should_post(alert::warning))
|
||||
{
|
||||
alerts().post_alert(save_resume_data_alert(boost::shared_ptr<entry>()
|
||||
, get_handle(), "won't save resume data, torrent does not have a complete resume state yet"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_storage->async_save_resume_data(
|
||||
bind(&torrent::on_save_resume_data, shared_from_this(), _1, _2));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue