mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-03-11 04:51:08 +00:00
id(ip) is now enforced
This commit is contained in:
parent
d96f8814d3
commit
a28de30fce
1
libtorrent/test/compile-dht.sh
Normal file
1
libtorrent/test/compile-dht.sh
Normal file
@ -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
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user