From b52027a02a0ae19617a57b82de0d62f69d2d406b Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Fri, 26 Feb 2016 19:16:17 -0800 Subject: [PATCH] set enable_dht to true in session::start_dht(entry) This function needs to enable the dht to match its semantics in pre 1.1 versions --- include/libtorrent/aux_/session_impl.hpp | 1 + src/session_handle.cpp | 2 +- src/session_impl.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index a5f066498..c155301fb 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -327,6 +327,7 @@ namespace libtorrent #ifndef TORRENT_NO_DEPRECATE entry dht_state() const; + void start_dht_deprecated(entry const& startup_state); #endif void on_dht_announce(error_code const& e); void on_dht_name_lookup(error_code const& e diff --git a/src/session_handle.cpp b/src/session_handle.cpp index 6e160f4df..cf359759b 100644 --- a/src/session_handle.cpp +++ b/src/session_handle.cpp @@ -468,7 +468,7 @@ namespace libtorrent void session_handle::start_dht(entry const& startup_state) { #ifndef TORRENT_DISABLE_DHT - TORRENT_ASYNC_CALL1(start_dht, startup_state); + TORRENT_ASYNC_CALL1(start_dht_deprecated, startup_state); #else TORRENT_UNUSED(startup_state); #endif diff --git a/src/session_impl.cpp b/src/session_impl.cpp index dc695b902..dc87c438a 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -5704,6 +5704,12 @@ retry: if (!m_dht) return entry(); return m_dht->state(); } + + void session_impl::start_dht_deprecated(entry const& startup_state) + { + m_settings.set_bool(settings_pack::enable_dht, true); + start_dht(startup_state); + } #endif void session_impl::add_dht_node_name(std::pair const& node)