diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 87d478729..f3d97885f 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2056,7 +2056,7 @@ namespace aux { { mutex_t::scoped_lock l(m_mutex); if (m_listen_sockets.empty()) return 0; - return m_listen_sockets.front().external_port;; + return m_listen_sockets.front().external_port; } void session_impl::announce_lsd(sha1_hash const& ih) diff --git a/src/torrent.cpp b/src/torrent.cpp index dd73b8784..e660a72cf 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -1013,7 +1013,7 @@ namespace libtorrent { m_last_dht_announce = now; m_ses.m_dht->announce(m_torrent_file->info_hash() - , m_ses.m_listen_sockets.front().external_port + , m_ses.listen_port() , bind(&torrent::on_dht_announce_response_disp, self, _1)); } #endif @@ -1070,8 +1070,7 @@ namespace libtorrent req.num_want = (req.event == tracker_request::stopped) ?0:m_settings.num_want; - req.listen_port = m_ses.m_listen_sockets.empty() - ?0:m_ses.m_listen_sockets.front().external_port; + req.listen_port = m_ses.listen_port(); req.key = m_ses.m_key; ptime now = time_now();