From 0ed0bdc50c80619ad8b10834773cba18932ffddf Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 1 Oct 2014 16:21:29 +0000 Subject: [PATCH] remove pointless DHT extension (for IPv6) --- src/kademlia/node.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/kademlia/node.cpp b/src/kademlia/node.cpp index 7b9c63f3f..87dcbe87f 100644 --- a/src/kademlia/node.cpp +++ b/src/kademlia/node.cpp @@ -561,40 +561,18 @@ namespace detail { void TORRENT_EXTRA_EXPORT write_nodes_entry(entry& r, nodes_t const& nodes) { - bool ipv6_nodes = false; entry& n = r["nodes"]; std::back_insert_iterator out(n.string()); for (nodes_t::const_iterator i = nodes.begin() , end(nodes.end()); i != end; ++i) { - if (!i->addr().is_v4()) - { - ipv6_nodes = true; - continue; - } + if (!i->addr().is_v4()) continue; std::copy(i->id.begin(), i->id.end(), out); write_endpoint(udp::endpoint(i->addr(), i->port()), out); } - - if (ipv6_nodes) - { - entry& p = r["nodes2"]; - std::string endpoint; - for (nodes_t::const_iterator i = nodes.begin() - , end(nodes.end()); i != end; ++i) - { - if (!i->addr().is_v6()) continue; - endpoint.resize(18 + 20); - std::string::iterator out = endpoint.begin(); - std::copy(i->id.begin(), i->id.end(), out); - out += 20; - write_endpoint(udp::endpoint(i->addr(), i->port()), out); - endpoint.resize(out - endpoint.begin()); - p.list().push_back(entry(endpoint)); - } - } } } + using detail::write_nodes_entry; // verifies that a message has all the required