fixed connection limit to take web seeds into account as well
This commit is contained in:
@@ -3861,6 +3861,10 @@ namespace libtorrent
|
||||
TORRENT_ASSERT(!web->resolving);
|
||||
if (web->resolving) return;
|
||||
|
||||
if (int(m_connections.size()) >= m_max_connections
|
||||
|| m_ses.num_connections() >= m_ses.max_connections())
|
||||
return;
|
||||
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " resolving web seed: " << web->url << "\n";
|
||||
#endif
|
||||
@@ -4003,6 +4007,10 @@ namespace libtorrent
|
||||
|
||||
if (m_ses.is_aborted()) return;
|
||||
|
||||
if (int(m_connections.size()) >= m_max_connections
|
||||
|| m_ses.num_connections() >= m_ses.max_connections())
|
||||
return;
|
||||
|
||||
tcp::endpoint a(host->endpoint());
|
||||
|
||||
using boost::tuples::ignore;
|
||||
@@ -4074,6 +4082,10 @@ namespace libtorrent
|
||||
return;
|
||||
}
|
||||
|
||||
if (int(m_connections.size()) >= m_max_connections
|
||||
|| m_ses.num_connections() >= m_ses.max_connections())
|
||||
return;
|
||||
|
||||
tcp::endpoint a(host->endpoint());
|
||||
connect_web_seed(web, a);
|
||||
}
|
||||
@@ -6596,7 +6608,11 @@ namespace libtorrent
|
||||
// ---- WEB SEEDS ----
|
||||
|
||||
// if we have everything we want we don't need to connect to any web-seed
|
||||
if (!is_finished() && !m_web_seeds.empty() && m_files_checked)
|
||||
if (!is_finished() && !m_web_seeds.empty() && m_files_checked
|
||||
&& int(m_connections.size()) < m_max_connections
|
||||
&& int(m_ses.m_connections.size()) < m_ses.max_connections())
|
||||
return;
|
||||
|
||||
{
|
||||
// keep trying web-seeds if there are any
|
||||
// first find out which web seeds we are connected to
|
||||
|
Reference in New Issue
Block a user