fix issue of adding duplicate incoming connections indefinitely to peer list when allow_multiple_connections_per_ip is enabled

This commit is contained in:
Arvid Norberg 2011-04-24 23:26:54 +00:00
parent 7d5df3eaa9
commit 2add9d193a
1 changed files with 11 additions and 0 deletions

View File

@ -1367,6 +1367,17 @@ namespace libtorrent
// to still exist when we get back there, to assign the new // to still exist when we get back there, to assign the new
// peer connection pointer to it. The peer list must // peer connection pointer to it. The peer list must
// be left intact. // be left intact.
// if we allow multiple connections per IP, and this peer
// was incoming and it never advertised its listen
// port, we don't really know which peer it was. In order
// to avoid adding one entry for every single connection
// the peer makes to us, don't save this entry
if (m_torrent->settings().allow_multiple_connections_per_ip
&& !p->connectable)
{
erase_peer(p);
}
} }
void policy::peer_is_interesting(peer_connection& c) void policy::peer_is_interesting(peer_connection& c)