From a28de30fce65b4429358ea0f24a695f672893ee3 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Tue, 30 Jul 2013 19:08:55 -0300 Subject: [PATCH] id(ip) is now enforced --- libtorrent/test/compile-dht.sh | 1 + libtorrent/test/test_dht.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 libtorrent/test/compile-dht.sh diff --git a/libtorrent/test/compile-dht.sh b/libtorrent/test/compile-dht.sh new file mode 100644 index 00000000..1f721ed8 --- /dev/null +++ b/libtorrent/test/compile-dht.sh @@ -0,0 +1 @@ +gcc -o test_dht test_dht.cpp -I../include/ -DBOOST_ASIO_SEPARATE_COMPILATION -lboost_system -lssl -lpthread .libs/libtest.a ../src/.libs/libtorrent-rasterbar.a -lrt diff --git a/libtorrent/test/test_dht.cpp b/libtorrent/test/test_dht.cpp index db3d52f7..dc1aadfc 100644 --- a/libtorrent/test/test_dht.cpp +++ b/libtorrent/test/test_dht.cpp @@ -108,7 +108,8 @@ void send_dht_msg(node_impl& node, char const* msg, udp::endpoint const& ep e["t"] = t; e["z"] = "q"; entry::dictionary_type& a = e["x"].dict(); - a["id"] = generate_next().to_string(); + //a["id"] = generate_next().to_string(); + a["id"] = generate_id(ep.address()).to_string(); if (info_hash) a["infoHash"] = std::string(info_hash, 20); if (name) a["n"] = name; if (!token.empty()) a["token"] = token; @@ -126,6 +127,7 @@ void send_dht_msg(node_impl& node, char const* msg, udp::endpoint const& ep // this yields a lot of output. too much // std::cerr << "sending: " << e << "\n"; #endif + //fprintf(stderr, "sending: %s\n", msg_buf); lazy_entry decoded; error_code ec;