don't reject peer connections just because the peerlist is full
This commit is contained in:
parent
a9cc2101c6
commit
83ba5afaa5
|
@ -847,8 +847,12 @@ namespace libtorrent
|
|||
|
||||
if (int(m_peers.size()) >= m_torrent->settings().max_peerlist_size)
|
||||
{
|
||||
c.disconnect(errors::too_many_connections);
|
||||
return false;
|
||||
erase_peers();
|
||||
if (int(m_peers.size()) >= m_torrent->settings().max_peerlist_size)
|
||||
{
|
||||
c.disconnect(errors::too_many_connections);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#if TORRENT_USE_IPV6
|
||||
|
|
|
@ -5173,7 +5173,13 @@ namespace libtorrent
|
|||
}
|
||||
#endif
|
||||
if (!m_policy.new_connection(*p, m_ses.session_time()))
|
||||
{
|
||||
#if defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " CLOSING CONNECTION "
|
||||
<< p->remote() << " policy::new_connection returned false (i.e. peer list full)\n";
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
TORRENT_CATCH (std::exception& e)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue