From bdee276a981484137f6bd3419f9fdc7c2a53d0f3 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 20 Aug 2010 07:01:11 +0000 Subject: [PATCH] fixed proxy support for udp trackers --- src/udp_tracker_connection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/udp_tracker_connection.cpp b/src/udp_tracker_connection.cpp index b146af6d1..437053c03 100644 --- a/src/udp_tracker_connection.cpp +++ b/src/udp_tracker_connection.cpp @@ -51,6 +51,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/io.hpp" #include "libtorrent/aux_/session_impl.hpp" #include "libtorrent/escape_string.hpp" +#include "libtorrent/broadcast_socket.hpp" // for is_any namespace libtorrent { @@ -275,7 +276,10 @@ namespace libtorrent if (m_abort) return false; // ignore packet not sent from the tracker - if (m_target != ep) return false; + // if m_target is inaddr_any, it suggests that we + // sent the packet through a proxy only knowing + // the hostname, in which case this packet might be for us + if (!is_any(m_target.address()) && m_target != ep) return false; if (e) fail(e);