From b215c0c5e6d4c86e2505070142f57b35561ea0ec Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 6 Mar 2011 20:38:24 +0000 Subject: [PATCH] fix for incoming connections with torrents exempted from ip filter --- src/torrent.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/torrent.cpp b/src/torrent.cpp index 2e18c8786..b79059bc2 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -5016,6 +5016,15 @@ namespace libtorrent m_has_incoming = true; + if (m_apply_ip_filter + && m_ses.m_ip_filter.access(p->remote().address()) & ip_filter::blocked) + { + if (m_ses.m_alerts.should_post()) + m_ses.m_alerts.post_alert(peer_blocked_alert(get_handle(), p->remote().address())); + p->disconnect(errors::banned_by_ip_filter); + return false; + } + if ((m_state == torrent_status::queued_for_checking || m_state == torrent_status::checking_files || m_state == torrent_status::checking_resume_data)