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
This commit is contained in:
Steven Siloti 2016-02-26 19:16:17 -08:00
parent 02ddb7ad1d
commit b52027a02a
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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<std::string, int> const& node)