forked from premiere/premiere-libtorrent
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
|
||||
bool handled = false;
|
||||
|
|
|
@ -817,6 +817,13 @@ namespace libtorrent
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_torrent_file->num_pieces() == 0)
|
||||
{
|
||||
set_error(errors::torrent_invalid_length, "");
|
||||
pause();
|
||||
return;
|
||||
}
|
||||
|
||||
// the shared_from_this() will create an intentional
|
||||
// cycle of ownership, se the hpp file for description.
|
||||
m_owning_storage = new piece_manager(shared_from_this(), m_torrent_file
|
||||
|
|
Loading…
Reference in New Issue