From e49c49c89215e4fdaa94dc8ad3ff0af978d76e58 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 17 Apr 2007 23:06:00 +0000 Subject: [PATCH] fixes #35 --- src/policy.cpp | 9 +++++++++ src/session_impl.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/policy.cpp b/src/policy.cpp index e6746cd00..a85e26582 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -998,6 +998,15 @@ namespace libtorrent // because of the push_back() i = boost::prior(m_peers.end()); if (flags & 0x02) p.seed = true; + + // try to send a DHT ping to this peer + // as well, to figure out if it supports + // DHT (uTorrent and BitComet doesn't + // advertise support) +#ifndef TORRENT_DISABLE_DHT + udp::endpoint node(remote.address(), remote.port()); + m_torrent->session().add_dht_node(node); +#endif } else { diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 7094fe34c..6c3e300c2 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -560,7 +560,7 @@ namespace libtorrent { namespace detail } #endif -#ifndef TORRENT_DISABLE_DHT +#ifndef TORRENT_DISABLE_DHT void session_impl::add_dht_node(udp::endpoint n) { if (m_dht) m_dht->add_node(n);