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 arvidn
parent f4a95131c5
commit 0882d02c53
2 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit ea3bffe3c53bca5e0976914ea951193ba43fbed6
Subproject commit f0e42435dce3ff227cc81b17ccab143b21d8f771

View File

@ -1749,7 +1749,7 @@ namespace libtorrent
#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)
{
@ -2186,6 +2186,7 @@ namespace libtorrent
if (j->ret == piece_manager::fatal_disk_error)
{
m_resume_data.reset();
handle_disk_error(j);
auto_managed(false);
pause();
@ -2303,8 +2304,7 @@ namespace libtorrent
// --- UNFINISHED PIECES ---
int const num_blocks_per_piece =
static_cast<int>(torrent_file().piece_length()) / block_size();
int const num_blocks_per_piece = torrent_file().piece_length() / block_size();
for (std::map<int, bitfield>::const_iterator i
= m_add_torrent_params->unfinished_pieces.begin()