piece picker assert fix

This commit is contained in:
Marcos Pinto 2007-11-04 21:32:07 +00:00
parent 0898680adc
commit 67e79250d2
1 changed files with 10 additions and 10 deletions

View File

@ -962,16 +962,16 @@ 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() , has_index(index));
, has_index(index)); 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());