From 5710cdebf4a4b89ec63224aa7a9e7c7cdf3d6650 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 14 Oct 2008 00:56:44 +0000 Subject: [PATCH] make auto-unchoke less likely to open up slots when maxed out --- src/session_impl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 844a006e7..bc4a10b78 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1462,7 +1462,8 @@ namespace aux { // limit if (m_stat.upload_rate() < upload_limit * 0.9f && m_allowed_upload_slots <= m_num_unchoked + 1 - && congested_torrents < uncongested_torrents) + && congested_torrents < uncongested_torrents + && m_upload_channel.queue_size() < 2) { ++m_allowed_upload_slots; } @@ -1501,6 +1502,8 @@ namespace aux { if (p->peer_info_struct()->optimistically_unchoked) { // force a new optimistic unchoke + // since this one just got promoted into the + // proper unchoke set m_optimistic_unchoke_time_scaler = 0; p->peer_info_struct()->optimistically_unchoked = false; }