minor header cleanup and refactor (#1179)

This commit is contained in:
Alden Torres 2016-10-04 10:43:34 -04:00 committed by Arvid Norberg
parent be70afa4b8
commit 9343f2fbfb
5 changed files with 6 additions and 6 deletions

View File

@ -258,7 +258,7 @@ public:
bool is_full(int bucket) const; bool is_full(int bucket) const;
bool native_address(address addr) const bool native_address(address const& addr) const
{ {
return (addr.is_v4() && m_protocol == udp::v4()) return (addr.is_v4() && m_protocol == udp::v4())
|| (addr.is_v6() && m_protocol == udp::v6()); || (addr.is_v6() && m_protocol == udp::v6());

View File

@ -42,7 +42,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <libtorrent/socket_io.hpp> #include <libtorrent/socket_io.hpp>
#include <libtorrent/aux_/time.hpp> #include <libtorrent/aux_/time.hpp>
#include <libtorrent/config.hpp> #include <libtorrent/config.hpp>
#include <libtorrent/time.hpp>
#include <libtorrent/bloom_filter.hpp> #include <libtorrent/bloom_filter.hpp>
#include <libtorrent/session_settings.hpp> #include <libtorrent/session_settings.hpp>
#include <libtorrent/random.hpp> #include <libtorrent/random.hpp>

View File

@ -249,9 +249,10 @@ char const* traversal_algorithm::name() const
void traversal_algorithm::traverse(node_id const& id, udp::endpoint const& addr) void traversal_algorithm::traverse(node_id const& id, udp::endpoint const& addr)
{ {
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
if (id.is_all_zeros() && get_node().observer() != nullptr) dht_observer* logger = get_node().observer();
if (logger != nullptr && logger->should_log(dht_logger::traversal) && id.is_all_zeros())
{ {
get_node().observer()->log(dht_logger::traversal logger->log(dht_logger::traversal
, "[%p] WARNING node returned a list which included a node with id 0" , "[%p] WARNING node returned a list which included a node with id 0"
, static_cast<void*>(this)); , static_cast<void*>(this));
} }

View File

@ -67,7 +67,6 @@ const rlim_t rlim_infinity = RLIM_INFINITY;
#include "libtorrent/entry.hpp" #include "libtorrent/entry.hpp"
#include "libtorrent/session.hpp" #include "libtorrent/session.hpp"
#include "libtorrent/fingerprint.hpp" #include "libtorrent/fingerprint.hpp"
#include "libtorrent/entry.hpp"
#include "libtorrent/alert_types.hpp" #include "libtorrent/alert_types.hpp"
#include "libtorrent/invariant_check.hpp" #include "libtorrent/invariant_check.hpp"
#include "libtorrent/file.hpp" #include "libtorrent/file.hpp"
@ -5610,6 +5609,7 @@ namespace aux {
// postpone starting the DHT if we're still resolving the DHT router // postpone starting the DHT if we're still resolving the DHT router
if (m_outstanding_router_lookups > 0) return; if (m_outstanding_router_lookups > 0) return;
// TODO: refactor, move the storage to dht_tracker
m_dht_storage = m_dht_storage_constructor(m_dht_settings); m_dht_storage = m_dht_storage_constructor(m_dht_settings);
m_dht = std::make_shared<dht::dht_tracker>( m_dht = std::make_shared<dht::dht_tracker>(
static_cast<dht::dht_observer*>(this) static_cast<dht::dht_observer*>(this)

View File

@ -149,7 +149,7 @@ TORRENT_TEST(dual_stack)
TEST_EQUAL(peers6["values"].list().size(), 2); TEST_EQUAL(peers6["values"].list().size(), 2);
} }
TORRENT_TEST(put_immutable_item) TORRENT_TEST(put_items)
{ {
dht_settings sett = test_settings(); dht_settings sett = test_settings();
std::unique_ptr<dht_storage_interface> s(create_default_dht_storage(sett)); std::unique_ptr<dht_storage_interface> s(create_default_dht_storage(sett));