diff --git a/ChangeLog b/ChangeLog index 71aa95f04..132c5772a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ + * fixed time critical piece accounting in the request queue * fixed semantics of rate_limit_utp to also ignore per-torrent limits * fixed piece sorting bug of deadline pieces * fixed python binding build on Mac OS and BSD diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index fba8a6a5d..f69418bc8 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2207,6 +2207,8 @@ namespace libtorrent { if (i->block != b) continue; in_req_queue = true; + if (i - m_request_queue.begin() < m_queued_time_critical) + --m_queued_time_critical; m_request_queue.erase(i); break; } @@ -3070,6 +3072,9 @@ namespace libtorrent // the block, just ignore to cancel it. if (rit == m_request_queue.end()) return; + if (rit - m_request_queue.begin() < m_queued_time_critical) + --m_queued_time_critical; + t->picker().abort_download(block, peer_info_struct()); m_request_queue.erase(rit); // since we found it in the request queue, it means it hasn't been