ban self-connections, in order to not try them again

This commit is contained in:
Arvid Norberg 2009-05-07 05:10:19 +00:00
parent c8176cca55
commit bc20af9375
2 changed files with 3 additions and 0 deletions

View File

@ -2775,6 +2775,7 @@ namespace libtorrent
if (pid == m_ses.get_peer_id()) if (pid == m_ses.get_peer_id())
{ {
if (peer_info_struct()) peer_info_struct()->banned = true;
disconnect("closing connection to ourself", 1); disconnect("closing connection to ourself", 1);
return; return;
} }
@ -2791,6 +2792,7 @@ namespace libtorrent
// since it most likely is ourself then // since it most likely is ourself then
if (pid == m_ses.get_peer_id()) if (pid == m_ses.get_peer_id())
{ {
if (peer_info_struct()) peer_info_struct()->banned = true;
disconnect("closing connection to ourself", 1); disconnect("closing connection to ourself", 1);
return; return;
} }

View File

@ -4173,6 +4173,7 @@ namespace libtorrent
{ {
// if the remote endpoint is the same as the local endpoint, we're connected // if the remote endpoint is the same as the local endpoint, we're connected
// to ourselves // to ourselves
if (m_peer_info) m_peer_info->banned = true;
disconnect("connected to ourselves", 1); disconnect("connected to ourselves", 1);
return; return;
} }