From de8839cc62b94bcccd9c1b64c2ebaf97d8514b98 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 22 Jul 2005 17:16:23 +0000 Subject: [PATCH] *** empty log message *** --- src/peer_connection.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 7298fbea2..b2c5fa729 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2118,6 +2118,11 @@ namespace libtorrent #endif std::copy(m_recv_buffer.begin(), m_recv_buffer.begin() + 20, (char*)m_peer_id.begin()); + // disconnect if the peer has the same peer-id as ourself + // since it most likely is ourself then + if (m_peer_id == m_ses.get_peer_id()) + throw protocol_error("closing connection to ourself"); + if (!m_active) { // check to make sure we don't have another connection with the same