forked from premiere/premiere-libtorrent
fixed invalid iterator access in debug mode
This commit is contained in:
parent
679a594f4e
commit
fba4ae541c
|
@ -111,6 +111,12 @@ namespace libtorrent
|
|||
bool timed_out:1;
|
||||
|
||||
piece_block block;
|
||||
|
||||
bool operator==(pending_block const& b)
|
||||
{
|
||||
return b.skipped == skipped && b.block == block
|
||||
&& b.not_wanted == not_wanted && b.timed_out == timed_out;
|
||||
}
|
||||
};
|
||||
|
||||
struct has_block
|
||||
|
|
|
@ -1731,7 +1731,7 @@ namespace libtorrent
|
|||
if (t->alerts().should_post<unwanted_block_alert>())
|
||||
{
|
||||
t->alerts().post_alert(unwanted_block_alert(t->get_handle(), m_remote
|
||||
, m_peer_id, b.block_index, b.piece_index));
|
||||
, m_peer_id, b.block_index, b.piece_index));
|
||||
}
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << " *** The block we just got was not in the "
|
||||
|
@ -1936,7 +1936,7 @@ namespace libtorrent
|
|||
if (!qe.timed_out && !qe.not_wanted)
|
||||
picker.abort_download(qe.block);
|
||||
|
||||
TORRENT_ASSERT(m_download_queue.begin() + i != b);
|
||||
TORRENT_ASSERT(m_download_queue[block_index] == pending_b);
|
||||
m_download_queue.erase(m_download_queue.begin() + i);
|
||||
--i;
|
||||
--block_index;
|
||||
|
|
Loading…
Reference in New Issue