From bc20af9375ca4bea62c398c097fd384baddca97b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 7 May 2009 05:10:19 +0000 Subject: [PATCH] ban self-connections, in order to not try them again --- src/bt_peer_connection.cpp | 2 ++ src/peer_connection.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index a19198df0..67bb182dd 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -2775,6 +2775,7 @@ namespace libtorrent if (pid == m_ses.get_peer_id()) { + if (peer_info_struct()) peer_info_struct()->banned = true; disconnect("closing connection to ourself", 1); return; } @@ -2791,6 +2792,7 @@ namespace libtorrent // since it most likely is ourself then if (pid == m_ses.get_peer_id()) { + if (peer_info_struct()) peer_info_struct()->banned = true; disconnect("closing connection to ourself", 1); return; } diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 2b3fda7ab..94311a7f6 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -4173,6 +4173,7 @@ namespace libtorrent { // if the remote endpoint is the same as the local endpoint, we're connected // to ourselves + if (m_peer_info) m_peer_info->banned = true; disconnect("connected to ourselves", 1); return; }