increase connection limit for local peers if limits are ignored for local network in order to accept more incoming connections from the local network
This commit is contained in:
parent
6a5164b990
commit
dbffe3aee9
|
@ -1428,8 +1428,16 @@ namespace aux {
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't allow more connections than the max setting
|
// don't allow more connections than the max setting
|
||||||
if (num_connections() >= max_connections())
|
bool reject = false;
|
||||||
|
if (m_settings.ignore_limits_on_local_network && is_local(endp.address()))
|
||||||
|
reject = max_connections() < INT_MAX / 12
|
||||||
|
&& num_connections() >= max_connections() * 12 / 10;
|
||||||
|
else
|
||||||
|
reject = num_connections() >= max_connections();
|
||||||
|
|
||||||
|
if (reject)
|
||||||
{
|
{
|
||||||
|
// TODO: post alert
|
||||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||||
(*m_logger) << "number of connections limit exceeded (conns: "
|
(*m_logger) << "number of connections limit exceeded (conns: "
|
||||||
<< num_connections() << ", limit: " << max_connections()
|
<< num_connections() << ", limit: " << max_connections()
|
||||||
|
|
Loading…
Reference in New Issue