piece picker assert fix
This commit is contained in:
parent
0898680adc
commit
67e79250d2
|
@ -962,9 +962,8 @@ namespace libtorrent
|
||||||
int priority = p.priority(m_sequenced_download_threshold);
|
int priority = p.priority(m_sequenced_download_threshold);
|
||||||
TORRENT_ASSERT(priority < int(m_piece_info.size()));
|
TORRENT_ASSERT(priority < int(m_piece_info.size()));
|
||||||
|
|
||||||
TORRENT_ASSERT(p.downloading == 1);
|
if (p.downloading)
|
||||||
TORRENT_ASSERT(!p.have());
|
{
|
||||||
|
|
||||||
std::vector<downloading_piece>::iterator i
|
std::vector<downloading_piece>::iterator i
|
||||||
= std::find_if(m_downloads.begin()
|
= std::find_if(m_downloads.begin()
|
||||||
, m_downloads.end()
|
, m_downloads.end()
|
||||||
|
@ -972,6 +971,7 @@ namespace libtorrent
|
||||||
TORRENT_ASSERT(i != m_downloads.end());
|
TORRENT_ASSERT(i != m_downloads.end());
|
||||||
erase_download_piece(i);
|
erase_download_piece(i);
|
||||||
p.downloading = 0;
|
p.downloading = 0;
|
||||||
|
}
|
||||||
|
|
||||||
TORRENT_ASSERT(std::find_if(m_downloads.begin(), m_downloads.end()
|
TORRENT_ASSERT(std::find_if(m_downloads.begin(), m_downloads.end()
|
||||||
, has_index(index)) == m_downloads.end());
|
, has_index(index)) == m_downloads.end());
|
||||||
|
|
Loading…
Reference in New Issue