diff --git a/ChangeLog b/ChangeLog index 2d220db09..760b761e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -91,6 +91,8 @@ * resume data no longer has timestamps of files * require C++11 to build libtorrent + * fix tracker announce issue, advertising port 0 in secondary IPv6 announce + * fix missing boost/noncopyable.hpp includes * fix python binding for torrent_info::creation_date() 1.1.10 release diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 90ff51914..74877b3b8 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -1046,8 +1046,8 @@ namespace aux { #endif #ifdef TORRENT_USE_OPENSSL - bool use_ssl = req.ssl_ctx != nullptr; - req.ssl_ctx = &m_ssl_ctx; + bool const use_ssl = req.ssl_ctx != nullptr; + if (!use_ssl) req.ssl_ctx = &m_ssl_ctx; #endif if (req.outgoing_socket) @@ -5415,7 +5415,22 @@ namespace aux { else return std::uint16_t(sock->tcp_external_port); } + +#ifdef TORRENT_USE_OPENSSL + for (auto const& s : m_listen_sockets) + { + if (s->ssl == transport::plaintext) + { + if (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none) + return std::uint16_t(s->udp_external_port); + else + return std::uint16_t(s->tcp_external_port); + } + } + return 0; +#else return std::uint16_t(m_listen_sockets.front()->tcp_external_port); +#endif } // TODO: 2 this function should be removed and users need to deal with the diff --git a/src/torrent.cpp b/src/torrent.cpp index 5bb9934c8..5f3999d8a 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2899,11 +2899,19 @@ bool is_downloading_state(int const st) req.outgoing_socket = aep.socket; #ifndef TORRENT_DISABLE_LOGGING - debug_log("==> TRACKER REQUEST \"%s\" event: %s abort: %d fails: %d upd: %d" + debug_log("==> TRACKER REQUEST \"%s\" event: %s abort: %d ssl: %p " + "port: %d ssl-port: %d fails: %d upd: %d" , req.url.c_str() , (req.event == tracker_request::stopped ? "stopped" : req.event == tracker_request::started ? "started" : "") , m_abort +#ifdef TORRENT_USE_OPENSSL + , static_cast(req.ssl_ctx) +#else + , static_cast(nullptr) +#endif + , m_ses.listen_port() + , m_ses.ssl_listen_port() , aep.fails , aep.updating); diff --git a/src/tracker_manager.cpp b/src/tracker_manager.cpp index 83e329483..1f519c9cb 100644 --- a/src/tracker_manager.cpp +++ b/src/tracker_manager.cpp @@ -270,11 +270,7 @@ namespace libtorrent { , req.listen_port); #endif - TORRENT_ASSERT(!m_abort || req.event == tracker_request::stopped); - if (m_abort && req.event != tracker_request::stopped) - return; - - std::string protocol = req.url.substr(0, req.url.find(':')); + std::string const protocol = req.url.substr(0, req.url.find(':')); #ifdef TORRENT_USE_OPENSSL if (protocol == "http" || protocol == "https")