fix limiting incoming connections to torrent limit
This commit is contained in:
parent
e1b1123c48
commit
bc656acebb
|
@ -2177,6 +2177,11 @@ namespace libtorrent
|
||||||
throw protocol_error("session is closing");
|
throw protocol_error("session is closing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (int(m_connections.size()) >= m_max_connections)
|
||||||
|
{
|
||||||
|
throw protocol_error("reached connection limit");
|
||||||
|
}
|
||||||
|
|
||||||
TORRENT_ASSERT(m_connections.find(p) == m_connections.end());
|
TORRENT_ASSERT(m_connections.find(p) == m_connections.end());
|
||||||
peer_iterator ci = m_connections.insert(p).first;
|
peer_iterator ci = m_connections.insert(p).first;
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue