From bb48b6e83c4ec392673ac42cdeb9de6d7dd50311 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 10 Apr 2015 01:50:42 +0000 Subject: [PATCH] eliminate one more session dependency in peer_connection --- include/libtorrent/aux_/session_impl.hpp | 1 - include/libtorrent/aux_/session_interface.hpp | 1 - include/libtorrent/bt_peer_connection.hpp | 5 ----- src/peer_connection.cpp | 3 +-- src/session_impl.cpp | 9 --------- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index ffc7ee25c..c190ef20f 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -1134,7 +1134,6 @@ namespace libtorrent #if defined TORRENT_LOGGING virtual void session_log(char const* fmt, ...) const; virtual void session_vlog(char const* fmt, va_list& va) const; - void log_all_torrents(peer_connection* p); // this list of tracker loggers serves as tracker_callbacks when // shutting down. This list is just here to keep them alive during diff --git a/include/libtorrent/aux_/session_interface.hpp b/include/libtorrent/aux_/session_interface.hpp index a590dc197..93a8b2b4e 100644 --- a/include/libtorrent/aux_/session_interface.hpp +++ b/include/libtorrent/aux_/session_interface.hpp @@ -106,7 +106,6 @@ namespace libtorrent { namespace aux #if defined TORRENT_LOGGING virtual void session_log(char const* fmt, ...) const = 0; virtual void session_vlog(char const* fmt, va_list& va) const = 0; - virtual void log_all_torrents(peer_connection* p) = 0; #endif #if TORRENT_USE_ASSERTS diff --git a/include/libtorrent/bt_peer_connection.hpp b/include/libtorrent/bt_peer_connection.hpp index d18bd9ffe..56a829a8c 100644 --- a/include/libtorrent/bt_peer_connection.hpp +++ b/include/libtorrent/bt_peer_connection.hpp @@ -71,11 +71,6 @@ namespace libtorrent { class torrent; - namespace detail - { - struct session_impl; - } - class TORRENT_EXTRA_EXPORT bt_peer_connection : public peer_connection { diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 954e0c1d9..5e4bc2d8b 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -390,9 +390,9 @@ namespace libtorrent return; } -#if defined TORRENT_LOGGING tcp::endpoint bound_ip = m_ses.bind_outgoing_socket(*m_socket , m_remote.address(), ec); +#if defined TORRENT_LOGGING peer_log(">>> BIND [ dst: %s ec: %s ]", print_endpoint(bound_ip).c_str() , ec.message().c_str()); #endif @@ -1196,7 +1196,6 @@ namespace libtorrent // we couldn't find the torrent! #if defined TORRENT_LOGGING peer_log("*** couldn't find a torrent with the given info_hash: %s torrents:", to_hex(ih.to_string()).c_str()); - m_ses.log_all_torrents(this); #endif #ifndef TORRENT_DISABLE_DHT diff --git a/src/session_impl.cpp b/src/session_impl.cpp index b7a7b5fb8..047c5c8f3 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -4296,15 +4296,6 @@ retry: m_alerts.emplace_alert(buf); } - - void session_impl::log_all_torrents(peer_connection* p) - { - for (session_impl::torrent_map::const_iterator i = m_torrents.begin() - , end(m_torrents.end()); i != end; ++i) - { - p->peer_log(" %s", to_hex(i->second->torrent_file().info_hash().to_string()).c_str()); - } - } #endif void session_impl::get_torrent_status(std::vector* ret