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)