diff --git a/include/libtorrent/kademlia/dht_tracker.hpp b/include/libtorrent/kademlia/dht_tracker.hpp index 8821ab197..af253c885 100644 --- a/include/libtorrent/kademlia/dht_tracker.hpp +++ b/include/libtorrent/kademlia/dht_tracker.hpp @@ -37,16 +37,16 @@ POSSIBILITY OF SUCH DAMAGE. #include -#include "libtorrent/kademlia/node.hpp" -#include "libtorrent/kademlia/node_id.hpp" -#include "libtorrent/kademlia/traversal_algorithm.hpp" -#include "libtorrent/kademlia/dos_blocker.hpp" +#include +#include +#include +#include -#include "libtorrent/session_settings.hpp" -#include "libtorrent/udp_socket.hpp" -#include "libtorrent/socket.hpp" -#include "libtorrent/deadline_timer.hpp" -#include "libtorrent/span.hpp" +#include +#include +#include +#include +#include namespace libtorrent { @@ -58,8 +58,6 @@ namespace libtorrent namespace libtorrent { namespace dht { - struct dht_tracker; - struct TORRENT_EXTRA_EXPORT dht_tracker final : udp_socket_interface , std::enable_shared_from_this @@ -118,7 +116,7 @@ namespace libtorrent { namespace dht , std::function data_cb, std::string salt = std::string()); // send an arbitrary DHT request directly to a node - void direct_request(udp::endpoint ep, entry& e + void direct_request(udp::endpoint const& ep, entry& e , std::function f); #ifndef TORRENT_NO_DEPRECATE diff --git a/src/file.cpp b/src/file.cpp index b755e05e6..0b43c3dd7 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "libtorrent/aux_/disable_warnings_push.hpp" + #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" @@ -60,6 +62,8 @@ POSSIBILITY OF SUCH DAMAGE. #pragma GCC diagnostic pop #endif +#include "libtorrent/aux_/disable_warnings_pop.hpp" + #include "libtorrent/config.hpp" #include "libtorrent/alloca.hpp" #include "libtorrent/file.hpp" @@ -80,6 +84,8 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/io.hpp" #endif +#include "libtorrent/aux_/disable_warnings_push.hpp" + #include #include // for IOV_MAX @@ -138,6 +144,8 @@ static_assert(sizeof(lseek(0, 0, 0)) >= 8, "64 bit file operations are required" #endif // posix part +#include "libtorrent/aux_/disable_warnings_pop.hpp" + #if TORRENT_USE_PREADV # if defined TORRENT_WINDOWS namespace diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp index 8f2d48834..1aa22ea80 100644 --- a/src/kademlia/dht_tracker.cpp +++ b/src/kademlia/dht_tracker.cpp @@ -30,30 +30,31 @@ POSSIBILITY OF SUCH DAMAGE. */ +#include "libtorrent/kademlia/dht_tracker.hpp" + #include #include -#include "libtorrent/config.hpp" +#include -#include "libtorrent/kademlia/node.hpp" -#include "libtorrent/kademlia/node_id.hpp" -#include "libtorrent/kademlia/traversal_algorithm.hpp" -#include "libtorrent/kademlia/dht_tracker.hpp" -#include "libtorrent/kademlia/msg.hpp" -#include "libtorrent/kademlia/dht_observer.hpp" +#include +#include +#include +#include +#include -#include "libtorrent/socket.hpp" -#include "libtorrent/socket_io.hpp" -#include "libtorrent/bencode.hpp" -#include "libtorrent/io.hpp" -#include "libtorrent/version.hpp" -#include "libtorrent/time.hpp" -#include "libtorrent/performance_counters.hpp" // for counters -#include "libtorrent/aux_/time.hpp" -#include "libtorrent/session_status.hpp" +#include +#include +#include +#include +#include +#include +#include // for counters +#include +#include #ifndef TORRENT_DISABLE_LOGGING -#include "libtorrent/hex.hpp" // to_hex +#include // to_hex #endif using libtorrent::dht::node; @@ -134,12 +135,15 @@ namespace libtorrent { namespace dht update_storage_node_ids(); #ifndef TORRENT_DISABLE_LOGGING - m_log->log(dht_logger::tracker, "starting IPv4 DHT tracker with node id: %s" - , aux::to_hex(m_dht.nid()).c_str()); + if (m_log->should_log(dht_logger::tracker)) + { + m_log->log(dht_logger::tracker, "starting IPv4 DHT tracker with node id: %s" + , aux::to_hex(m_dht.nid()).c_str()); #if TORRENT_USE_IPV6 - m_log->log(dht_logger::tracker, "starting IPv6 DHT tracker with node id: %s" - , aux::to_hex(m_dht6.nid()).c_str()); + m_log->log(dht_logger::tracker, "starting IPv6 DHT tracker with node id: %s" + , aux::to_hex(m_dht6.nid()).c_str()); #endif + } #endif } @@ -471,7 +475,7 @@ namespace libtorrent { namespace dht #endif } - void dht_tracker::direct_request(udp::endpoint ep, entry& e + void dht_tracker::direct_request(udp::endpoint const& ep, entry& e , std::function f) { #if TORRENT_USE_IPV6