From 29c618c3e5bff1f471d412184a0bc2c240977952 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 27 Jul 2015 16:53:25 -0700 Subject: [PATCH] merge bittorrent-slow start fix from RC_1_0 --- src/peer_connection.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 1b6110709..fe6191315 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -4804,8 +4804,13 @@ namespace libtorrent // if our download rate isn't increasing significantly anymore, end slow // start. The 10kB is to have some slack here. - if (m_slow_start && m_downloaded_last_second > 0 - && m_downloaded_last_second + 10000 + // we can't do this when we're choked, because we aren't sending any + // requests yet, so there hasn't been an opportunity to ramp up the + // connection yet. + if (m_slow_start + && !m_peer_choked + && m_downloaded_last_second > 0 + && m_downloaded_last_second + 5000 >= m_statistics.last_payload_downloaded()) { m_slow_start = false;