From 1945adaddff556e85b5e126d05df81b9ae60c832 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Tue, 8 Jul 2014 15:00:58 +0400 Subject: [PATCH] check for empty response --- libtorrent/src/kademlia/node.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index ae7db616..53dd572e 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -309,9 +309,11 @@ namespace } } - void putData_confirm(dht_storage_item& item) + void putData_confirm(entry::list_type const& values_list, dht_storage_item& item) { - item.confirmed = true; + if( !values_list.empty() ) { + item.confirmed = true; + } } void putData_fun(std::vector > const& v, @@ -605,7 +607,7 @@ bool node_impl::refresh_storage() { // search for nodes with ids close to id or with peers // for info-hash id. then send putData to them. boost::intrusive_ptr ta(new dht_get(*this, username, resource, multi, - boost::bind(&putData_confirm, boost::ref(item)), + boost::bind(&putData_confirm, _1, boost::ref(item)), boost::bind(&putData_fun, _1, boost::ref(*this), entryP, item.sig_p, item.sig_user), item.confirmed)); ta->start();