Browse Source

incompatible dht change2: "a" => "x"

miguelfreitas
Miguel Freitas 12 years ago
parent
commit
7275eb698c
  1. 4
      libtorrent/dht_flood.py
  2. 2
      libtorrent/src/kademlia/find_data.cpp
  3. 4
      libtorrent/src/kademlia/node.cpp
  4. 2
      libtorrent/src/kademlia/refresh.cpp
  5. 2
      libtorrent/src/kademlia/rpc_manager.cpp
  6. 2
      libtorrent/test/test_dht.cpp

4
libtorrent/dht_flood.py

@ -60,9 +60,9 @@ query = 'get_peers' @@ -60,9 +60,9 @@ query = 'get_peers'
print 'test random info-hashes'
for i in xrange(1, 30000):
send_dht_message({'a': {'id': node_id, 'info_hash': random_key()}, 'q': query, 'z': 'q', 't': '%d' % i})
send_dht_message({'x': {'id': node_id, 'info_hash': random_key()}, 'q': query, 'z': 'q', 't': '%d' % i})
print 'test random peer-ids'
for i in xrange(1, 30000):
send_dht_message({'a': {'id': random_key(), 'info_hash': random_key()}, 'q': query, 'z': 'q', 't': '%d' % i})
send_dht_message({'x': {'id': random_key(), 'info_hash': random_key()}, 'q': query, 'z': 'q', 't': '%d' % i})

2
libtorrent/src/kademlia/find_data.cpp

@ -207,7 +207,7 @@ bool find_data::invoke(observer_ptr o) @@ -207,7 +207,7 @@ bool find_data::invoke(observer_ptr o)
entry e;
e["z"] = "q";
e["q"] = "get_peers";
entry& a = e["a"];
entry& a = e["x"];
a["info_hash"] = m_target.to_string();
if (m_noseeds) a["noseed"] = 1;
return m_node.m_rpc.invoke(e, o->target_ep(), o);

4
libtorrent/src/kademlia/node.cpp

@ -283,7 +283,7 @@ namespace @@ -283,7 +283,7 @@ namespace
entry e;
e["z"] = "q";
e["q"] = "announce_peer";
entry& a = e["a"];
entry& a = e["x"];
a["info_hash"] = ih.to_string();
a["port"] = listen_port;
a["token"] = i->second;
@ -608,7 +608,7 @@ void node_impl::incoming_request(msg const& m, entry& e) @@ -608,7 +608,7 @@ void node_impl::incoming_request(msg const& m, entry& e)
key_desc_t top_desc[] = {
{"q", lazy_entry::string_t, 0, 0},
{"a", lazy_entry::dict_t, 0, key_desc_t::parse_children},
{"x", lazy_entry::dict_t, 0, key_desc_t::parse_children},
{"id", lazy_entry::string_t, 20, key_desc_t::last_child},
};

2
libtorrent/src/kademlia/refresh.cpp

@ -73,7 +73,7 @@ bool refresh::invoke(observer_ptr o) @@ -73,7 +73,7 @@ bool refresh::invoke(observer_ptr o)
entry e;
e["z"] = "q";
e["q"] = "find_node";
entry& a = e["a"];
entry& a = e["x"];
a["target"] = target().to_string();
return m_node.m_rpc.invoke(e, o->target_ep(), o);
}

2
libtorrent/src/kademlia/rpc_manager.cpp

@ -466,7 +466,7 @@ bool rpc_manager::invoke(entry& e, udp::endpoint target_addr @@ -466,7 +466,7 @@ bool rpc_manager::invoke(entry& e, udp::endpoint target_addr
if (m_destructing) return false;
e["z"] = "q";
entry& a = e["a"];
entry& a = e["x"];
add_our_id(a);
std::string transaction_id;

2
libtorrent/test/test_dht.cpp

@ -107,7 +107,7 @@ void send_dht_msg(node_impl& node, char const* msg, udp::endpoint const& ep @@ -107,7 +107,7 @@ void send_dht_msg(node_impl& node, char const* msg, udp::endpoint const& ep
e["q"] = msg;
e["t"] = t;
e["z"] = "q";
entry::dictionary_type& a = e["a"].dict();
entry::dictionary_type& a = e["x"].dict();
a["id"] = generate_next().to_string();
if (info_hash) a["info_hash"] = std::string(info_hash, 20);
if (name) a["n"] = name;

Loading…
Cancel
Save