refactor to use std::shared_ptr with traversal_algorithm (#1056)

refactor to use std::shared_ptr with traversal_algorithm. use a more stable linaro gcc link
This commit is contained in:
Alden Torres 2016-09-02 16:42:55 -04:00 committed by Arvid Norberg
parent 19dd9d323a
commit fd4c09d7b2
26 changed files with 73 additions and 116 deletions

View File

@ -90,9 +90,9 @@ install:
- 'if [ $arch == "arm" ]; then
cd test;
wget https://releases.linaro.org/components/toolchain/binaries/latest-5/armv8l-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_armv8l-linux-gnueabihf.tar.xz;
tar xf gcc-linaro-5.3-2016.02-x86_64_armv8l-linux-gnueabihf.tar.xz;
export PATH=${PWD}/gcc-linaro-5.3-2016.02-x86_64_armv8l-linux-gnueabihf/bin:${PATH};
wget -O gcc-linaro.tar.xz https://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/armv8l-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_armv8l-linux-gnueabihf.tar.xz;
tar xf gcc-linaro.tar.xz;
export PATH=${PWD}/gcc-linaro-5.3.1-2016.05-x86_64_armv8l-linux-gnueabihf/bin:${PATH};
armv8l-linux-gnueabihf-g++ --version;
wget -O boost.zip http://pilotfiber.dl.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.zip;
unzip -qq boost.zip;

View File

@ -68,7 +68,7 @@ protected:
struct direct_observer : observer
{
direct_observer(boost::intrusive_ptr<traversal_algorithm> const& algo
direct_observer(std::shared_ptr<traversal_algorithm> const& algo
, udp::endpoint const& ep, node_id const& id)
: observer(algo, ep, id)
{}

View File

@ -43,10 +43,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <map>
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/intrusive_ptr.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
namespace libtorrent { namespace dht
{
@ -86,7 +82,7 @@ protected:
struct find_data_observer : traversal_observer
{
find_data_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id)
: traversal_observer(algorithm, ep, id)
{}

View File

@ -79,7 +79,7 @@ class get_item_observer : public find_data_observer
{
public:
get_item_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id)
: find_data_observer(algorithm, ep, id)
{}

View File

@ -85,7 +85,7 @@ private:
struct get_peers_observer : find_data_observer
{
get_peers_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id)
: find_data_observer(algorithm, ep, id)
{}
@ -96,7 +96,7 @@ struct get_peers_observer : find_data_observer
struct obfuscated_get_peers_observer : traversal_observer
{
obfuscated_get_peers_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id)
: traversal_observer(algorithm, ep, id)
{}

View File

@ -79,7 +79,7 @@ struct null_type {};
class announce_observer : public observer
{
public:
announce_observer(boost::intrusive_ptr<traversal_algorithm> const& algo
announce_observer(std::shared_ptr<traversal_algorithm> const& algo
, udp::endpoint const& ep, node_id const& id)
: observer(algo, ep, id)
{}

View File

@ -59,7 +59,7 @@ struct TORRENT_EXTRA_EXPORT observer : boost::noncopyable
friend TORRENT_EXTRA_EXPORT void intrusive_ptr_add_ref(observer const*);
friend TORRENT_EXTRA_EXPORT void intrusive_ptr_release(observer const*);
observer(boost::intrusive_ptr<traversal_algorithm> const& a
observer(std::shared_ptr<traversal_algorithm> const& a
, udp::endpoint const& ep, node_id const& id)
: m_sent()
, m_algorithm(a)
@ -139,7 +139,7 @@ private:
time_point m_sent;
const boost::intrusive_ptr<traversal_algorithm> m_algorithm;
const std::shared_ptr<traversal_algorithm> m_algorithm;
node_id m_id;

View File

@ -71,7 +71,7 @@ protected:
struct put_data_observer : traversal_observer
{
put_data_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id, std::string const& token)
: traversal_observer(algorithm, ep, id)
, m_token(token)

View File

@ -171,8 +171,8 @@ public:
// iterates over the router nodes added
typedef std::set<udp::endpoint>::const_iterator router_iterator;
router_iterator router_begin() const { return m_router_nodes.begin(); }
router_iterator router_end() const { return m_router_nodes.end(); }
router_iterator begin() const { return m_router_nodes.begin(); }
router_iterator end() const { return m_router_nodes.end(); }
enum add_node_status_t {
failed_to_add = 0,

View File

@ -57,7 +57,7 @@ struct udp_socket_interface;
struct TORRENT_EXTRA_EXPORT null_observer : public observer
{
null_observer(boost::intrusive_ptr<traversal_algorithm> const& a
null_observer(std::shared_ptr<traversal_algorithm> const& a
, udp::endpoint const& ep, node_id const& id): observer(a, ep, id) {}
virtual void reply(msg const&) { flags |= flag_done; }
};

View File

@ -43,7 +43,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_push.hpp"
#include <boost/noncopyable.hpp>
#include <boost/intrusive_ptr.hpp>
#include "libtorrent/aux_/disable_warnings_pop.hpp"
namespace libtorrent { struct dht_lookup; }
@ -55,6 +54,7 @@ class node;
// this class may not be instantiated as a stack object
struct TORRENT_EXTRA_EXPORT traversal_algorithm : boost::noncopyable
, std::enable_shared_from_this<traversal_algorithm>
{
void traverse(node_id const& id, udp::endpoint addr);
void finished(observer_ptr o);
@ -83,6 +83,9 @@ struct TORRENT_EXTRA_EXPORT traversal_algorithm : boost::noncopyable
protected:
std::shared_ptr<traversal_algorithm> self()
{ return shared_from_this(); }
// returns true if we're done
bool add_requests();
@ -97,22 +100,9 @@ protected:
virtual bool invoke(observer_ptr) { return false; }
friend void intrusive_ptr_add_ref(traversal_algorithm* p)
{
TORRENT_ASSERT(p->m_ref_count < 0xffff);
p->m_ref_count++;
}
friend void intrusive_ptr_release(traversal_algorithm* p)
{
if (--p->m_ref_count == 0)
delete p;
}
node& m_node;
std::vector<observer_ptr> m_results;
node_id const m_target;
std::uint16_t m_ref_count;
std::uint16_t m_invoke_count;
std::uint16_t m_branch_factor;
std::uint16_t m_responses;
@ -128,7 +118,7 @@ protected:
struct traversal_observer : observer
{
traversal_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id)
: observer(algorithm, ep, id)
{}

View File

@ -67,4 +67,3 @@ namespace libtorrent {
}
#endif // TORRENT_PEER_CLASS_SET_HPP_INCLUDED

View File

@ -86,7 +86,7 @@ namespace libtorrent
// it is a comma-separated list of IP or device names with ports. For
// example: "eth0:6881,eth1:6881" or "127.0.0.1:6881"
TORRENT_EXTRA_EXPORT void parse_comma_separated_string_port(
std::string const& in, std::vector<std::pair<std::string, int> >& out);
std::string const& in, std::vector<std::pair<std::string, int>>& out);
// this parses the string that's used as the outgoing_interfaces setting.
// it is a comma separated list of IPs and device names. For example:

View File

@ -121,7 +121,7 @@ void find_data::got_write_token(node_id const& n, std::string write_token)
observer_ptr find_data::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id)
{
observer_ptr o(new (ptr) find_data_observer(this, ep, id));
observer_ptr o(new (ptr) find_data_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif

View File

@ -128,7 +128,7 @@ char const* get_item::name() const { return "get"; }
observer_ptr get_item::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id)
{
observer_ptr o(new (ptr) get_item_observer(this, ep, id));
observer_ptr o(new (ptr) get_item_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif

View File

@ -163,7 +163,7 @@ bool get_peers::invoke(observer_ptr o)
observer_ptr get_peers::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id)
{
observer_ptr o(new (ptr) get_peers_observer(this, ep, id));
observer_ptr o(new (ptr) get_peers_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -189,7 +189,7 @@ observer_ptr obfuscated_get_peers::new_observer(void* ptr
{
if (m_obfuscated)
{
observer_ptr o(new (ptr) obfuscated_get_peers_observer(this, ep, id));
observer_ptr o(new (ptr) obfuscated_get_peers_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -197,7 +197,7 @@ observer_ptr obfuscated_get_peers::new_observer(void* ptr
}
else
{
observer_ptr o(new (ptr) get_peers_observer(this, ep, id));
observer_ptr o(new (ptr) get_peers_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -222,10 +222,8 @@ bool obfuscated_get_peers::invoke(observer_ptr o)
// our node-list for this traversal algorithm, to
// allow the get_peers traversal to regress in case
// nodes further down end up being dead
for (std::vector<observer_ptr>::iterator i = m_results.begin()
, end(m_results.end()); i != end; ++i)
for (auto const& node : m_results)
{
observer* const node = i->get();
// don't re-request from nodes that didn't respond
if (node->flags & observer::flag_failed) continue;
// don't interrupt with queries that are already in-flight
@ -270,10 +268,8 @@ void obfuscated_get_peers::done()
// oops, we failed to switch over to the non-obfuscated
// mode early enough. do it now
boost::intrusive_ptr<get_peers> ta(new get_peers(m_node, m_target
, m_data_callback
, m_nodes_callback
, m_noseeds));
auto ta = std::make_shared<get_peers>(m_node, m_target
, m_data_callback, m_nodes_callback, m_noseeds);
// don't call these when the obfuscated_get_peers
// is done, we're passing them on to be called when

View File

@ -202,20 +202,19 @@ void node::bootstrap(std::vector<udp::endpoint> const& nodes
node_id target = m_id;
make_id_secret(target);
boost::intrusive_ptr<dht::bootstrap> r(new dht::bootstrap(*this, target, f));
auto r = std::make_shared<dht::bootstrap>(*this, target, f);
m_last_self_refresh = aux::time_now();
#ifndef TORRENT_DISABLE_LOGGING
int count = 0;
#endif
for (std::vector<udp::endpoint>::const_iterator i = nodes.begin()
, end(nodes.end()); i != end; ++i)
for (auto const& n : nodes)
{
#ifndef TORRENT_DISABLE_LOGGING
++count;
#endif
r->add_entry(node_id(nullptr), *i, observer::flag_initial);
r->add_entry(node_id(nullptr), n, observer::flag_initial);
}
// make us start as far away from our node ID as possible
@ -348,7 +347,7 @@ void node::incoming(msg const& m)
namespace
{
void announce_fun(std::vector<std::pair<node_entry, std::string> > const& v
void announce_fun(std::vector<std::pair<node_entry, std::string>> const& v
, node& node, int listen_port, sha1_hash const& ih, int flags)
{
#ifndef TORRENT_DISABLE_LOGGING
@ -362,23 +361,21 @@ namespace
#endif
// create a dummy traversal_algorithm
boost::intrusive_ptr<traversal_algorithm> algo(
new traversal_algorithm(node, (node_id::min)()));
auto algo = std::make_shared<traversal_algorithm>(node, node_id());
// store on the first k nodes
for (std::vector<std::pair<node_entry, std::string> >::const_iterator i = v.begin()
, end(v.end()); i != end; ++i)
for (auto const& p : v)
{
#ifndef TORRENT_DISABLE_LOGGING
if (node.observer())
{
node.observer()->log(dht_logger::node, "announce-distance: %d"
, (160 - distance_exp(ih, i->first.id)));
, (160 - distance_exp(ih, p.first.id)));
}
#endif
void* ptr = node.m_rpc.allocate_observer();
if (ptr == nullptr) return;
observer_ptr o(new (ptr) announce_observer(algo, i->first.ep(), i->first.id));
observer_ptr o(new (ptr) announce_observer(algo, p.first.ep(), p.first.id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -388,11 +385,11 @@ namespace
entry& a = e["a"];
a["info_hash"] = ih;
a["port"] = listen_port;
a["token"] = i->second;
a["token"] = p.second;
a["seed"] = (flags & node::flag_seed) ? 1 : 0;
if (flags & node::flag_implied_port) a["implied_port"] = 1;
node.stats_counters().inc_stats_counter(counters::dht_announce_peer_out);
node.m_rpc.invoke(e, i->first.ep(), o);
node.m_rpc.invoke(e, p.first.ep(), o);
}
}
}
@ -425,7 +422,7 @@ void node::get_peers(sha1_hash const& info_hash
// search for nodes with ids close to id or with peers
// for info-hash id. then send announce_peer to them.
boost::intrusive_ptr<dht::get_peers> ta;
std::shared_ptr<dht::get_peers> ta;
if (m_settings.privacy_lookups)
{
ta.reset(new dht::obfuscated_get_peers(*this, info_hash, dcallback, ncallback, noseeds));
@ -460,12 +457,11 @@ void node::direct_request(udp::endpoint ep, entry& e
, std::function<void(msg const&)> f)
{
// not really a traversal
boost::intrusive_ptr<direct_traversal> algo(
new direct_traversal(*this, (node_id::min)(), f));
auto algo = std::make_shared<direct_traversal>(*this, node_id(), f);
void* ptr = m_rpc.allocate_observer();
if (ptr == nullptr) return;
observer_ptr o(new (ptr) direct_observer(algo, ep, (node_id::min)()));
observer_ptr o(new (ptr) direct_observer(algo, ep, node_id()));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -485,8 +481,8 @@ void node::get_item(sha1_hash const& target
}
#endif
boost::intrusive_ptr<dht::get_item> ta;
ta.reset(new dht::get_item(*this, target, std::bind(f, _1), find_data::nodes_callback()));
auto ta = std::make_shared<dht::get_item>(*this, target
, std::bind(f, _1), find_data::nodes_callback());
ta->start();
}
@ -502,22 +498,22 @@ void node::get_item(public_key const& pk, std::string const& salt
}
#endif
boost::intrusive_ptr<dht::get_item> ta;
ta.reset(new dht::get_item(*this, pk, salt, f, find_data::nodes_callback()));
auto ta = std::make_shared<dht::get_item>(*this, pk, salt, f
, find_data::nodes_callback());
ta->start();
}
namespace {
void put(std::vector<std::pair<node_entry, std::string> > const& nodes
, boost::intrusive_ptr<dht::put_data> ta)
void put(std::vector<std::pair<node_entry, std::string>> const& nodes
, std::shared_ptr<put_data> ta)
{
ta->set_targets(nodes);
ta->start();
}
void put_data_cb(item i, bool auth
, boost::intrusive_ptr<put_data> ta
, std::shared_ptr<put_data> ta
, std::function<void(item&)> f)
{
// call data_callback only when we got authoritative data.
@ -544,13 +540,11 @@ void node::put_item(sha1_hash const& target, entry const& data, std::function<vo
item i;
i.assign(data);
boost::intrusive_ptr<dht::put_data> put_ta;
put_ta.reset(new dht::put_data(*this, std::bind(f, _2)));
auto put_ta = std::make_shared<dht::put_data>(*this, std::bind(f, _2));
put_ta->set_data(i);
boost::intrusive_ptr<dht::get_item> ta;
ta.reset(new dht::get_item(*this, target, get_item::data_callback(),
std::bind(&put, _1, put_ta)));
auto ta = std::make_shared<dht::get_item>(*this, target
, get_item::data_callback(), std::bind(&put, _1, put_ta));
ta->start();
}
@ -567,20 +561,18 @@ void node::put_item(public_key const& pk, std::string const& salt
}
#endif
boost::intrusive_ptr<dht::put_data> put_ta;
put_ta.reset(new dht::put_data(*this, f));
auto put_ta = std::make_shared<dht::put_data>(*this, f);
boost::intrusive_ptr<dht::get_item> ta;
ta.reset(new dht::get_item(*this, pk, salt
auto ta = std::make_shared<dht::get_item>(*this, pk, salt
, std::bind(&put_data_cb, _1, _2, put_ta, data_cb)
, std::bind(&put, _1, put_ta)));
, std::bind(&put, _1, put_ta));
ta->start();
}
struct ping_observer : observer
{
ping_observer(
boost::intrusive_ptr<traversal_algorithm> const& algorithm
std::shared_ptr<traversal_algorithm> const& algorithm
, udp::endpoint const& ep, node_id const& id)
: observer(algorithm, ep, id)
{}
@ -644,8 +636,7 @@ void node::tick()
{
node_id target = m_id;
make_id_secret(target);
boost::intrusive_ptr<dht::bootstrap> r(new dht::bootstrap(*this, target
, std::bind(&nop)));
auto r = std::make_shared<dht::bootstrap>(*this, target, std::bind(&nop));
r->start();
m_last_self_refresh = now;
return;
@ -683,8 +674,7 @@ void node::send_single_refresh(udp::endpoint const& ep, int bucket
// create a dummy traversal_algorithm
// this is unfortunately necessary for the observer
// to free itself from the pool when it's being released
boost::intrusive_ptr<traversal_algorithm> algo(
new traversal_algorithm(*this, (node_id::min)()));
auto algo = std::make_shared<traversal_algorithm>(*this, node_id());
observer_ptr o(new (ptr) ping_observer(algo, ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;

View File

@ -63,7 +63,7 @@ void put_data::set_targets(std::vector<std::pair<node_entry, std::string> > cons
void* ptr = m_node.m_rpc.allocate_observer();
if (ptr == nullptr) return;
observer_ptr o(new (ptr) put_data_observer(this, i->first.ep()
observer_ptr o(new (ptr) put_data_observer(self(), i->first.ep()
, i->first.id, i->second));
#if TORRENT_USE_ASSERTS

View File

@ -44,7 +44,7 @@ namespace libtorrent { namespace dht
observer_ptr bootstrap::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id)
{
observer_ptr o(new (ptr) get_peers_observer(this, ep, id));
observer_ptr o(new (ptr) get_peers_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -97,15 +97,13 @@ void bootstrap::done()
, static_cast<void*>(this));
#endif
for (std::vector<observer_ptr>::iterator i = m_results.begin()
, end(m_results.end()); i != end; ++i)
for (auto const& o : m_results)
{
if ((*i)->flags & observer::flag_queried) continue;
if (o->flags & observer::flag_queried) continue;
// this will send a ping
m_node.add_node((*i)->target_ep());
m_node.add_node(o->target_ep());
}
get_peers::done();
}
} } // namespace libtorrent::dht

View File

@ -82,7 +82,7 @@ void intrusive_ptr_release(observer const* o)
TORRENT_ASSERT(o->m_refs > 0);
if (--o->m_refs == 0)
{
boost::intrusive_ptr<traversal_algorithm> ta = o->algorithm();
auto ta = o->algorithm()->shared_from_this();
(const_cast<observer*>(o))->~observer();
ta->free_observer(const_cast<observer*>(o));
}

View File

@ -79,7 +79,7 @@ bool is_sorted(It b, It e, Cmp cmp)
observer_ptr traversal_algorithm::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id)
{
observer_ptr o(new (ptr) null_observer(boost::intrusive_ptr<traversal_algorithm>(this), ep, id));
observer_ptr o(new (ptr) null_observer(self(), ep, id));
#if TORRENT_USE_ASSERTS
o->m_in_constructor = false;
#endif
@ -91,7 +91,6 @@ traversal_algorithm::traversal_algorithm(
, node_id target)
: m_node(dht_node)
, m_target(target)
, m_ref_count(0)
, m_invoke_count(0)
, m_branch_factor(3)
, m_responses(0)
@ -385,10 +384,8 @@ void traversal_algorithm::done()
int closest_target = 160;
#endif
for (std::vector<observer_ptr>::iterator i = m_results.begin()
, end(m_results.end()); i != end; ++i)
for (auto const& o : m_results)
{
boost::intrusive_ptr<observer> o = *i;
if ((o->flags & (observer::flag_queried | observer::flag_failed)) == observer::flag_queried)
{
// set the done flag on any outstanding queries to prevent them from
@ -521,14 +518,11 @@ void traversal_algorithm::add_router_entries()
{
get_node().observer()->log(dht_logger::traversal
, "[%p] using router nodes to initiate traversal algorithm %d routers"
, static_cast<void*>(this), int(std::distance(m_node.m_table.router_begin(), m_node.m_table.router_end())));
, static_cast<void*>(this), int(std::distance(m_node.m_table.begin(), m_node.m_table.end())));
}
#endif
for (routing_table::router_iterator i = m_node.m_table.router_begin()
, end(m_node.m_table.router_end()); i != end; ++i)
{
add_entry(node_id(nullptr), *i, observer::flag_initial);
}
for (auto const& n : m_node.m_table)
add_entry(node_id(), n, observer::flag_initial);
}
void traversal_algorithm::init()
@ -644,4 +638,3 @@ void traversal_observer::reply(msg const& m)
}
} } // namespace libtorrent::dht

View File

@ -53,8 +53,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/alloca.hpp"
#include "libtorrent/pe_crypto.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/assert.hpp"
#include "libtorrent/span.hpp"
namespace libtorrent
{

View File

@ -31,8 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include "libtorrent/peer_class_set.hpp"
#include "libtorrent/peer_class.hpp"
#include <vector>
#include <algorithm> // for find
namespace libtorrent
@ -72,4 +71,3 @@ namespace libtorrent
pool.decref(c);
}
}

View File

@ -5194,7 +5194,7 @@ namespace aux {
{
#ifndef TORRENT_DISABLE_DHT
std::string const& node_list = m_settings.get_str(settings_pack::dht_bootstrap_nodes);
std::vector<std::pair<std::string, int> > nodes;
std::vector<std::pair<std::string, int>> nodes;
parse_comma_separated_string_port(node_list, nodes);
for (int i = 0; i < nodes.size(); ++i)

View File

@ -310,7 +310,7 @@ namespace libtorrent
// it is a comma-separated list of IP or device names with ports. For
// example: "eth0:6881,eth1:6881" or "127.0.0.1:6881"
void parse_comma_separated_string_port(std::string const& in
, std::vector<std::pair<std::string, int> >& out)
, std::vector<std::pair<std::string, int>>& out)
{
out.clear();

View File

@ -2966,8 +2966,7 @@ TORRENT_TEST(rpc_invalid_error_msg)
req["t"] = "\0\0\0\0";
g_sent_packets.clear();
boost::intrusive_ptr<traversal_algorithm> algo(new dht::traversal_algorithm(
node, node_id()));
auto algo = std::make_shared<dht::traversal_algorithm>(node, node_id());
observer_ptr o(new (rpc.allocate_observer()) null_observer(algo, source, node_id()));
#if TORRENT_USE_ASSERTS