fix potential infinite loop in request_time_critical_pieces

This commit is contained in:
Arvid Norberg
2011-08-05 17:35:09 +00:00
parent f38f8c57c4
commit 6a4708ef15
3 changed files with 12 additions and 1 deletions

View File

@@ -2745,6 +2745,10 @@ namespace libtorrent
if ((int)m_download_queue.size() + (int)m_request_queue.size()
> m_desired_queue_size * 2) return false;
if (on_parole()) return false;
if (m_disconnecting) return false;
boost::shared_ptr<torrent> t = m_torrent.lock();
TORRENT_ASSERT(t);
if (t->upload_mode()) return false;
return true;
}