fixes to prevent incorrect asserts
This commit is contained in:
@@ -2178,7 +2178,7 @@ namespace libtorrent
|
||||
if (!m_ignore_bandwidth_limits && max_receive > quota_left)
|
||||
max_receive = quota_left;
|
||||
|
||||
assert(max_receive > 0);
|
||||
if (max_receive == 0) return;
|
||||
|
||||
assert(m_recv_pos >= 0);
|
||||
assert(m_packet_size > 0);
|
||||
@@ -2276,10 +2276,7 @@ namespace libtorrent
|
||||
m_recv_pos += bytes_transferred;
|
||||
assert(m_recv_pos <= int(m_recv_buffer.size()));
|
||||
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
on_receive(error, bytes_transferred);
|
||||
}
|
||||
on_receive(error, bytes_transferred);
|
||||
|
||||
assert(m_packet_size > 0);
|
||||
|
||||
|
@@ -2330,15 +2330,11 @@ namespace libtorrent
|
||||
|
||||
torrent_handle torrent::get_handle() const
|
||||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
return torrent_handle(&m_ses, &m_checker, m_torrent_file.info_hash());
|
||||
}
|
||||
|
||||
session_settings const& torrent::settings() const
|
||||
{
|
||||
// INVARIANT_CHECK;
|
||||
|
||||
return m_ses.settings();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user