From cdd067fe4e8a5130f4f900a121dcf5e1d28fbf5e Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Thu, 2 Jun 2016 07:25:06 -0400 Subject: [PATCH] Minor cleanup (#775) Minor cleanup --- include/libtorrent/aux_/session_impl.hpp | 1 - include/libtorrent/session_handle.hpp | 4 ++-- src/session_impl.cpp | 21 +++++---------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index 2827d6492..7ebb5d440 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -490,7 +490,6 @@ namespace libtorrent void set_peer_id(peer_id const& id); void set_key(int key); - address listen_address() const; boost::uint16_t listen_port() const override; boost::uint16_t ssl_listen_port() const override; diff --git a/include/libtorrent/session_handle.hpp b/include/libtorrent/session_handle.hpp index 0bdc837ce..892dfed8a 100644 --- a/include/libtorrent/session_handle.hpp +++ b/include/libtorrent/session_handle.hpp @@ -249,10 +249,10 @@ namespace libtorrent bool is_paused() const; // This function enables dynamic-loading-of-torrent-files_. When a - // torrent is unloaded but needs to be availabe in memory, this function + // torrent is unloaded but needs to be available in memory, this function // is called **from within the libtorrent network thread**. From within // this thread, you can **not** use any of the public APIs of libtorrent - // itself. The the info-hash of the torrent is passed in to the function + // itself. The info-hash of the torrent is passed in to the function // and it is expected to fill in the passed in ``vector`` with the // .torrent file corresponding to it. // diff --git a/src/session_impl.cpp b/src/session_impl.cpp index b62341e27..ddfc3ca99 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -415,7 +415,7 @@ namespace aux { } // This function is called by the creating thread, not in the message loop's - // / io_service thread. + // io_service thread. // TODO: 2 is there a reason not to move all of this into init()? and just // post it to the io_service? void session_impl::start_session(settings_pack const& pack) @@ -546,10 +546,6 @@ namespace aux { std::bind(&session_impl::on_lsd_announce, this, _1)); TORRENT_ASSERT(!ec); -#ifndef TORRENT_DISABLE_DHT - update_dht_announce_interval(); -#endif - #ifndef TORRENT_DISABLE_LOGGING session_log(" done starting session"); #endif @@ -578,6 +574,10 @@ namespace aux { update_listen_interfaces(); reopen_listen_sockets(); } + +#ifndef TORRENT_DISABLE_DHT + update_dht_announce_interval(); +#endif } void session_impl::async_resolve(std::string const& host, int flags @@ -1499,7 +1499,6 @@ namespace aux { if (reopen_listen_port) { - error_code ec; reopen_listen_sockets(); } } @@ -5284,16 +5283,6 @@ namespace aux { } } - address session_impl::listen_address() const - { - for (std::list::const_iterator i = m_listen_sockets.begin() - , end(m_listen_sockets.end()); i != end; ++i) - { - if (i->external_address != address()) return i->external_address; - } - return address(); - } - boost::uint16_t session_impl::listen_port() const { // if peer connections are set up to be received over a socks