don't boost more connections than allowed within the connection_speed. i.e. honor the connection_speed setting

This commit is contained in:
Arvid Norberg 2010-12-18 23:18:20 +00:00
parent 9c64be0f9c
commit a1aaf4010a
1 changed files with 3 additions and 2 deletions

View File

@ -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)
{