diff --git a/include/libtorrent/ssl_stream.hpp b/include/libtorrent/ssl_stream.hpp index 8acec53d8..4f4a0b30b 100644 --- a/include/libtorrent/ssl_stream.hpp +++ b/include/libtorrent/ssl_stream.hpp @@ -84,7 +84,7 @@ public: executor_type get_executor() { return m_sock.get_executor(); } #endif - void set_host_name(std::string name) + void set_host_name(std::string const& name) { aux::openssl_set_tlsext_hostname(m_sock.native_handle(), name.c_str()); } diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index f1d1e934e..e9d4c5ff0 100644 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -327,12 +327,6 @@ namespace libtorrent { return; } - if (ec && ec != boost::asio::error::eof) - { - fail(ec); - return; - } - received_bytes(static_cast(data.size()) + parser.body_start()); // handle tracker response diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 8aaf01b6a..a9a33bc41 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -357,7 +357,7 @@ namespace aux { auto* ses = reinterpret_cast(arg); const char* servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); - if (!servername || strlen(servername) < 40) + if (!servername || std::strlen(servername) < 40) return SSL_TLSEXT_ERR_ALERT_FATAL; sha1_hash info_hash; @@ -7143,7 +7143,7 @@ namespace aux { } void tracker_logger::tracker_request_error(tracker_request const& - , error_code const& ec, const std::string& str + , error_code const& ec, std::string const& str , seconds32 const retry_interval) { TORRENT_UNUSED(retry_interval); diff --git a/src/tracker_manager.cpp b/src/tracker_manager.cpp index 415ecf6be..84b9c1d14 100644 --- a/src/tracker_manager.cpp +++ b/src/tracker_manager.cpp @@ -292,9 +292,9 @@ namespace libtorrent { } // we need to post the error to avoid deadlock - if (std::shared_ptr r = c.lock()) + if (auto r = c.lock()) ios.post(std::bind(&request_callback::tracker_request_error, r, std::move(req) - , error_code(errors::unsupported_url_protocol) + , errors::unsupported_url_protocol , "", seconds32(0))); }