Minor cleanup (#775)

Minor cleanup
This commit is contained in:
Alden Torres 2016-06-02 07:25:06 -04:00 committed by Arvid Norberg
parent 14d085f607
commit cdd067fe4e
3 changed files with 7 additions and 19 deletions

View File

@ -490,7 +490,6 @@ namespace libtorrent
void set_peer_id(peer_id const& id); void set_peer_id(peer_id const& id);
void set_key(int key); void set_key(int key);
address listen_address() const;
boost::uint16_t listen_port() const override; boost::uint16_t listen_port() const override;
boost::uint16_t ssl_listen_port() const override; boost::uint16_t ssl_listen_port() const override;

View File

@ -249,10 +249,10 @@ namespace libtorrent
bool is_paused() const; bool is_paused() const;
// This function enables dynamic-loading-of-torrent-files_. When a // 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 // is called **from within the libtorrent network thread**. From within
// this thread, you can **not** use any of the public APIs of libtorrent // 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<char>`` with the // and it is expected to fill in the passed in ``vector<char>`` with the
// .torrent file corresponding to it. // .torrent file corresponding to it.
// //

View File

@ -415,7 +415,7 @@ namespace aux {
} }
// This function is called by the creating thread, not in the message loop's // 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 // TODO: 2 is there a reason not to move all of this into init()? and just
// post it to the io_service? // post it to the io_service?
void session_impl::start_session(settings_pack const& pack) void session_impl::start_session(settings_pack const& pack)
@ -546,10 +546,6 @@ namespace aux {
std::bind(&session_impl::on_lsd_announce, this, _1)); std::bind(&session_impl::on_lsd_announce, this, _1));
TORRENT_ASSERT(!ec); TORRENT_ASSERT(!ec);
#ifndef TORRENT_DISABLE_DHT
update_dht_announce_interval();
#endif
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
session_log(" done starting session"); session_log(" done starting session");
#endif #endif
@ -578,6 +574,10 @@ namespace aux {
update_listen_interfaces(); update_listen_interfaces();
reopen_listen_sockets(); reopen_listen_sockets();
} }
#ifndef TORRENT_DISABLE_DHT
update_dht_announce_interval();
#endif
} }
void session_impl::async_resolve(std::string const& host, int flags void session_impl::async_resolve(std::string const& host, int flags
@ -1499,7 +1499,6 @@ namespace aux {
if (reopen_listen_port) if (reopen_listen_port)
{ {
error_code ec;
reopen_listen_sockets(); reopen_listen_sockets();
} }
} }
@ -5284,16 +5283,6 @@ namespace aux {
} }
} }
address session_impl::listen_address() const
{
for (std::list<listen_socket_t>::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 boost::uint16_t session_impl::listen_port() const
{ {
// if peer connections are set up to be received over a socks // if peer connections are set up to be received over a socks