From a1aaf4010a2ae75e2c253444768307c658fb62cd Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 18 Dec 2010 23:18:20 +0000 Subject: [PATCH] don't boost more connections than allowed within the connection_speed. i.e. honor the connection_speed setting --- src/torrent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 776bbfe88..e222e5f53 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -1900,9 +1900,10 @@ namespace libtorrent // this is the first tracker response for this torrent // instead of waiting one second for session_impl::on_tick() // to be called, connect to a few peers immediately - int conns = (std::min)((std::min)(m_ses.m_settings.torrent_connect_boost + int conns = (std::min)((std::min)((std::min)(m_ses.m_settings.torrent_connect_boost , m_ses.m_settings.connections_limit - m_ses.num_connections()) - , m_ses.m_half_open.free_slots()); + , m_ses.m_half_open.free_slots()) + , m_ses.m_boost_connections - m_ses.m_settings.connection_speed); while (want_more_peers() && conns > 0) {