ssl listen port fix and improved tracker announce logging

This commit is contained in:
Arvid Norberg 2018-10-26 15:10:10 +02:00 committed by Arvid Norberg
parent a5da48edd4
commit e1eb12e60f
4 changed files with 24 additions and 9 deletions

View File

@ -1,3 +1,4 @@
* fix tracker announce issue, advertising port 0 in secondary IPv6 announce
* fix missing boost/noncopyable.hpp includes * fix missing boost/noncopyable.hpp includes
* fix python binding for torrent_info::creation_date() * fix python binding for torrent_info::creation_date()

View File

@ -1320,7 +1320,7 @@ namespace aux {
#ifdef TORRENT_USE_OPENSSL #ifdef TORRENT_USE_OPENSSL
// SSL torrents use the SSL listen port // SSL torrents use the SSL listen port
if (req.ssl_ctx) req.listen_port = ssl_listen_port(); if (req.ssl_ctx) req.listen_port = ssl_listen_port();
req.ssl_ctx = &m_ssl_ctx; else req.ssl_ctx = &m_ssl_ctx;
#endif #endif
#if TORRENT_USE_I2P #if TORRENT_USE_I2P
if (!m_settings.get_str(settings_pack::i2p_hostname).empty()) if (!m_settings.get_str(settings_pack::i2p_hostname).empty())
@ -5511,7 +5511,16 @@ retry:
// potentially identify us if it is leaked elsewere // potentially identify us if it is leaked elsewere
if (m_settings.get_bool(settings_pack::force_proxy)) return 0; if (m_settings.get_bool(settings_pack::force_proxy)) return 0;
if (m_listen_sockets.empty()) return 0; if (m_listen_sockets.empty()) return 0;
#ifdef TORRENT_USE_OPENSSL
for (std::list<listen_socket_t>::const_iterator i = m_listen_sockets.begin()
, end(m_listen_sockets.end()); i != end; ++i)
{
if (!i->ssl) return i->external_port;
}
return 0;
#else
return m_listen_sockets.front().external_port; return m_listen_sockets.front().external_port;
#endif
} }
boost::uint16_t session_impl::ssl_listen_port() const boost::uint16_t session_impl::ssl_listen_port() const

View File

@ -3372,11 +3372,20 @@ namespace {
#endif #endif
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
debug_log("==> TRACKER REQUEST \"%s\" event: %s abort: %d" debug_log("==> TRACKER REQUEST \"%s\" event: %s abort: %d ssl: %p "
"port: %d ssl-port: %d force-proxy: %d"
, req.url.c_str() , req.url.c_str()
, (req.event==tracker_request::stopped?"stopped" , (req.event==tracker_request::stopped?"stopped"
:req.event==tracker_request::started?"started":"") :req.event==tracker_request::started?"started":"-")
, m_abort); , m_abort
#ifdef TORRENT_USE_OPENSSL
, static_cast<void*>(req.ssl_ctx)
#else
, static_cast<void*>(0)
#endif
, m_ses.listen_port()
, m_ses.ssl_listen_port()
, settings().get_bool(settings_pack::force_proxy));
// if we're not logging session logs, don't bother creating an // if we're not logging session logs, don't bother creating an
// observer object just for logging // observer object just for logging

View File

@ -286,11 +286,7 @@ namespace libtorrent
, req.listen_port); , req.listen_port);
#endif #endif
TORRENT_ASSERT(!m_abort || req.event == tracker_request::stopped); std::string const protocol = req.url.substr(0, req.url.find(':'));
if (m_abort && req.event != tracker_request::stopped)
return;
std::string protocol = req.url.substr(0, req.url.find(':'));
#ifdef TORRENT_USE_OPENSSL #ifdef TORRENT_USE_OPENSSL
if (protocol == "http" || protocol == "https") if (protocol == "http" || protocol == "https")