early resume data reset when fatal_disk_error (#798)

This commit is contained in:
Alden Torres 2016-06-07 18:44:39 -04:00 committed by Arvid Norberg
parent 3624ce6cfd
commit c8f7d89652
1 changed files with 3 additions and 4 deletions

View File

@ -1837,7 +1837,7 @@ namespace libtorrent
#endif #endif
} }
m_block_size_shift = root2((std::min)(int(block_size()), m_torrent_file->piece_length())); m_block_size_shift = root2((std::min)(block_size(), m_torrent_file->piece_length()));
if (m_torrent_file->num_pieces() > piece_picker::max_pieces) if (m_torrent_file->num_pieces() > piece_picker::max_pieces)
{ {
@ -2317,12 +2317,12 @@ namespace libtorrent
if (j->ret == piece_manager::fatal_disk_error) if (j->ret == piece_manager::fatal_disk_error)
{ {
m_resume_data.reset();
handle_disk_error(j); handle_disk_error(j);
auto_managed(false); auto_managed(false);
pause(); pause();
set_state(torrent_status::checking_files); set_state(torrent_status::checking_files);
if (should_check_files()) start_checking(); if (should_check_files()) start_checking();
m_resume_data.reset();
return; return;
} }
@ -2505,8 +2505,7 @@ namespace libtorrent
} }
// parse unfinished pieces // parse unfinished pieces
int num_blocks_per_piece = int num_blocks_per_piece = torrent_file().piece_length() / block_size();
static_cast<int>(torrent_file().piece_length()) / block_size();
if (bdecode_node unfinished_ent if (bdecode_node unfinished_ent
= m_resume_data->node.dict_find_list("unfinished")) = m_resume_data->node.dict_find_list("unfinished"))