forked from premiere/premiere-libtorrent
cleaned up save_resume_data
This commit is contained in:
parent
d8d0955910
commit
c04183d960
|
@ -3949,32 +3949,29 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
if (m_owning_storage.get())
|
if (!m_owning_storage.get())
|
||||||
{
|
|
||||||
TORRENT_ASSERT(m_storage);
|
|
||||||
if (m_state == torrent_status::queued_for_checking
|
|
||||||
|| m_state == torrent_status::checking_files)
|
|
||||||
{
|
|
||||||
if (alerts().should_post<save_resume_data_failed_alert>())
|
|
||||||
{
|
|
||||||
alerts().post_alert(save_resume_data_failed_alert(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
|
|
||||||
{
|
{
|
||||||
if (alerts().should_post<save_resume_data_failed_alert>())
|
if (alerts().should_post<save_resume_data_failed_alert>())
|
||||||
{
|
{
|
||||||
alerts().post_alert(save_resume_data_failed_alert(get_handle()
|
alerts().post_alert(save_resume_data_failed_alert(get_handle()
|
||||||
, "save resume data failed, torrent is being destructed"));
|
, "save resume data failed, torrent is being destructed"));
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TORRENT_ASSERT(m_storage);
|
||||||
|
if (m_state == torrent_status::queued_for_checking
|
||||||
|
|| m_state == torrent_status::checking_files)
|
||||||
|
{
|
||||||
|
if (alerts().should_post<save_resume_data_failed_alert>())
|
||||||
|
{
|
||||||
|
alerts().post_alert(save_resume_data_failed_alert(get_handle()
|
||||||
|
, "won't save resume data, torrent does not have a complete resume state yet"));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_storage->async_save_resume_data(
|
||||||
|
bind(&torrent::on_save_resume_data, shared_from_this(), _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool torrent::should_check_files() const
|
bool torrent::should_check_files() const
|
||||||
|
|
Loading…
Reference in New Issue