From 2ac84ed5f5463d72effd9d60d236db0189a605b2 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Tue, 20 Feb 2018 12:55:21 -0500 Subject: [PATCH] minor code cleanup in http_tracker_connection code --- include/libtorrent/http_tracker_connection.hpp | 8 +------- src/http_tracker_connection.cpp | 12 ++++-------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/include/libtorrent/http_tracker_connection.hpp b/include/libtorrent/http_tracker_connection.hpp index acb711209..d4ac2e103 100644 --- a/include/libtorrent/http_tracker_connection.hpp +++ b/include/libtorrent/http_tracker_connection.hpp @@ -33,27 +33,21 @@ POSSIBILITY OF SUCH DAMAGE. #ifndef TORRENT_HTTP_TRACKER_CONNECTION_HPP_INCLUDED #define TORRENT_HTTP_TRACKER_CONNECTION_HPP_INCLUDED -#include #include #include #include "libtorrent/config.hpp" -#include "libtorrent/lazy_entry.hpp" #include "libtorrent/peer_id.hpp" -#include "libtorrent/tracker_manager.hpp" -#include "libtorrent/i2p_stream.hpp" #include "libtorrent/error_code.hpp" namespace libtorrent { + class tracker_manager; struct http_connection; - class entry; class http_parser; struct bdecode_node; struct peer_entry; - namespace aux { struct session_settings; } - class TORRENT_EXTRA_EXPORT http_tracker_connection : public tracker_connection { diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index 9f2b52113..d41306445 100644 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -31,9 +31,9 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "libtorrent/config.hpp" -#include "libtorrent/gzip.hpp" #include "libtorrent/socket_io.hpp" +#include #include #include #include @@ -45,19 +45,14 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/tracker_manager.hpp" #include "libtorrent/http_tracker_connection.hpp" #include "libtorrent/http_connection.hpp" -#include "libtorrent/entry.hpp" -#include "libtorrent/bencode.hpp" -#include "libtorrent/torrent.hpp" +#include "libtorrent/aux_/escape_string.hpp" #include "libtorrent/io.hpp" #include "libtorrent/socket.hpp" -#include "libtorrent/broadcast_socket.hpp" // for is_local #include "libtorrent/string_util.hpp" // for is_i2p_url #include "libtorrent/aux_/session_settings.hpp" #include "libtorrent/resolver_interface.hpp" #include "libtorrent/ip_filter.hpp" -using namespace std::placeholders; - namespace libtorrent { http_tracker_connection::http_tracker_connection( @@ -197,6 +192,7 @@ namespace libtorrent { return; } + using namespace std::placeholders; m_tracker_connection = std::make_shared(get_io_service(), m_man.host_resolver() , std::bind(&http_tracker_connection::on_response, shared_from_this(), _1, _2, _3) , true, settings.get_int(settings_pack::max_http_recv_buffer_size) @@ -394,7 +390,7 @@ namespace libtorrent { else { // if there's no peer_id, just initialize it to a bunch of zeroes - std::fill_n(ret.pid.begin(), 20, 0); + ret.pid.clear(); } // extract ip