Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
minor code cleanup in http_tracker_connection code
  • Loading branch information
aldenml authored and arvidn committed Feb 21, 2018
1 parent 53b4725 commit 2ac84ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
8 changes: 1 addition & 7 deletions include/libtorrent/http_tracker_connection.hpp
Expand Up @@ -33,27 +33,21 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_HTTP_TRACKER_CONNECTION_HPP_INCLUDED
#define TORRENT_HTTP_TRACKER_CONNECTION_HPP_INCLUDED

#include <string>
#include <vector>
#include <memory>

#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
{
Expand Down
12 changes: 4 additions & 8 deletions src/http_tracker_connection.cpp
Expand Up @@ -31,9 +31,9 @@ POSSIBILITY OF SUCH DAMAGE.
*/

#include "libtorrent/config.hpp"
#include "libtorrent/gzip.hpp"
#include "libtorrent/socket_io.hpp"

#include <string>
#include <functional>
#include <vector>
#include <list>
Expand All @@ -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(
Expand Down Expand Up @@ -197,6 +192,7 @@ namespace libtorrent {
return;
}

using namespace std::placeholders;
m_tracker_connection = std::make_shared<http_connection>(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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2ac84ed

Please sign in to comment.