fixed bug introduced when adding the separate request queue

This commit is contained in:
Arvid Norberg 2005-09-29 23:31:39 +00:00
parent 394c046fad
commit 7cfc0b2e44
1 changed files with 11 additions and 2 deletions

View File

@ -1492,9 +1492,18 @@ namespace libtorrent
std::deque<piece_block>::iterator it std::deque<piece_block>::iterator it
= std::find(m_download_queue.begin(), m_download_queue.end(), block); = std::find(m_download_queue.begin(), m_download_queue.end(), block);
assert(it != m_download_queue.end()); if (it == m_download_queue.end())
{
it = std::find(m_request_queue.begin(), m_request_queue.end(), block);
assert(it != m_request_queue.end());
if (it == m_request_queue.end()) return;
m_request_queue.erase(it);
}
else
{
m_download_queue.erase(it); m_download_queue.erase(it);
}
send_block_requests(); send_block_requests();
int block_offset = block.block_index * m_torrent->block_size(); int block_offset = block.block_index * m_torrent->block_size();