From c9d245e9f167b8e23d305af3df4b0ae1f781238f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 3 Oct 2007 16:57:20 +0000 Subject: [PATCH] handles case where a request in the allow fast set is rejected --- src/peer_connection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index a4d66f79c..209833de5 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -730,6 +730,15 @@ namespace libtorrent << " *** PIECE NOT IN REQUEST QUEUE\n"; } #endif + if (has_peer_choked()) + { + // if we're choked and we got a rejection of + // a piece in the allowed fast set, remove it + // from the allow fast set. + std::vector::iterator i = std::find( + m_allowed_fast.begin(), m_allowed_fast.end(), r.piece); + if (i != m_allowed_fast.end()) m_allowed_fast.erase(i); + } if (m_request_queue.empty()) { if (m_download_queue.size() < 2)