fixed issue with 0-sized torrents and verify_piece assert
This commit is contained in:
parent
5adb8d5533
commit
e8523a3ad4
|
@ -3104,7 +3104,8 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TORRENT_ASSERT(verify_piece(r));
|
// the verification will fail for coalesced blocks
|
||||||
|
TORRENT_ASSERT(verify_piece(r) || m_request_large_blocks);
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
|
|
|
@ -817,6 +817,13 @@ namespace libtorrent
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_torrent_file->num_pieces() == 0)
|
||||||
|
{
|
||||||
|
set_error(errors::torrent_invalid_length, "");
|
||||||
|
pause();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// the shared_from_this() will create an intentional
|
// the shared_from_this() will create an intentional
|
||||||
// cycle of ownership, se the hpp file for description.
|
// cycle of ownership, se the hpp file for description.
|
||||||
m_owning_storage = new piece_manager(shared_from_this(), m_torrent_file
|
m_owning_storage = new piece_manager(shared_from_this(), m_torrent_file
|
||||||
|
|
Loading…
Reference in New Issue