diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index 2e594f90b..d81c5d00f 100644 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -553,7 +553,7 @@ namespace libtorrent ipv6_peers.clear(); } #else - bdecode_node ipv6_peers = 0; + bdecode_node ipv6_peers; #endif /* // if we didn't receive any peers. We don't care if we're stopping anyway diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp index 0def32230..600acfca3 100644 --- a/src/kademlia/dht_tracker.cpp +++ b/src/kademlia/dht_tracker.cpp @@ -76,7 +76,7 @@ namespace libtorrent { namespace dht { bdecode_node ver = e.dict_find_string("v"); if (!ver) return "generic"; - std::string const& client = ver->string_value(); + std::string const& client = ver.string_value(); if (client.size() < 2) { return client; @@ -408,7 +408,7 @@ namespace libtorrent { namespace dht { #ifdef TORRENT_DHT_VERBOSE_LOGGING TORRENT_LOG(dht_tracker) << "<== " << ep << " ERROR: not a dictionary: " - << print_entry(e, true); + << print_entry(m_msg, true); #endif // it's not a good idea to send invalid messages // especially not in response to an invalid message diff --git a/src/kademlia/get_peers.cpp b/src/kademlia/get_peers.cpp index e5f848a78..87db5a360 100644 --- a/src/kademlia/get_peers.cpp +++ b/src/kademlia/get_peers.cpp @@ -73,11 +73,11 @@ void get_peers_observer::reply(msg const& m) { TORRENT_LOG(traversal) << "[" << m_algorithm.get() << "] PEERS" - << " invoke-count: " << m_algorithm.invoke_count() - << " branch-factor: " << m_algorithm.branch_factor() + << " invoke-count: " << m_algorithm->invoke_count() + << " branch-factor: " << m_algorithm->branch_factor() << " addr: " << m.addr << " id: " << node_id(id.string_ptr()) - << " distance: " << distance_exp(m_algorithm.target(), node_id(id.string_ptr())) + << " distance: " << distance_exp(m_algorithm->target(), node_id(id.string_ptr())) << " p: " << ((end - peers) / 6); } #endif @@ -98,7 +98,7 @@ void get_peers_observer::reply(msg const& m) << " branch-factor: " << m_algorithm->branch_factor() << " addr: " << m.addr << " id: " << node_id(id.string_ptr()) - << " distance: " << distance_exp(m_algorithm->target(), node_id(id->string_ptr())) + << " distance: " << distance_exp(m_algorithm->target(), node_id(id.string_ptr())) << " p: " << n.list_size(); } #endif diff --git a/src/kademlia/rpc_manager.cpp b/src/kademlia/rpc_manager.cpp index 00120c2bf..0062b068b 100644 --- a/src/kademlia/rpc_manager.cpp +++ b/src/kademlia/rpc_manager.cpp @@ -248,7 +248,7 @@ void rpc_manager::check_invariant() const void rpc_manager::unreachable(udp::endpoint const& ep) { #ifdef TORRENT_DHT_VERBOSE_LOGGING - TORRENT_LOG(rpc) << time_now_string() << " PORT_UNREACHABLE [ ip: " << ep << " ]"; + TORRENT_LOG(rpc) << aux::time_now_string() << " PORT_UNREACHABLE [ ip: " << ep << " ]"; #endif for (transactions_t::iterator i = m_transactions.begin(); diff --git a/src/kademlia/traversal_algorithm.cpp b/src/kademlia/traversal_algorithm.cpp index eb977e44c..7600107bb 100644 --- a/src/kademlia/traversal_algorithm.cpp +++ b/src/kademlia/traversal_algorithm.cpp @@ -243,7 +243,7 @@ void traversal_algorithm::traverse(node_id const& id, udp::endpoint addr) #ifdef TORRENT_DHT_VERBOSE_LOGGING if (id.is_all_zeros()) { - TORRENT_LOG(traversal) << time_now_string() << "[" << this << "] WARNING node returned a list which included a node with id 0"; + TORRENT_LOG(traversal) << aux::time_now_string() << "[" << this << "] WARNING node returned a list which included a node with id 0"; } #endif @@ -535,9 +535,9 @@ void traversal_observer::reply(msg const& m) bdecode_node nid = r.dict_find_string("id"); TORRENT_LOG(traversal) << "[" << m_algorithm.get() << "] " "RESPONSE id: " << to_hex(nid.string_value()) - << " invoke-count: " << m_algorithm.invoke_count() + << " invoke-count: " << m_algorithm->invoke_count() << " addr: " << m.addr - << " type: " << m_algorithm.name() + << " type: " << m_algorithm->name() ; #endif // look for nodes diff --git a/test/test_ssl.cpp b/test/test_ssl.cpp index fd6b3b5d7..d46b1856e 100644 --- a/test/test_ssl.cpp +++ b/test/test_ssl.cpp @@ -116,7 +116,7 @@ void test_ssl(int test_idx, bool use_utp) test_config_t const& test = test_config[test_idx]; - fprintf(stderr, "\n%s TEST: %s Protocol: %s\n\n", time_now_string(), test.name, use_utp ? "uTP": "TCP"); + fprintf(stderr, "\n%s TEST: %s Protocol: %s\n\n", aux::time_now_string(), test.name, use_utp ? "uTP": "TCP"); // in case the previous run was terminated error_code ec; @@ -206,7 +206,7 @@ void test_ssl(int test_idx, bool use_utp) port = ses2.listen_port(); fprintf(stderr, "%s: ses1: connecting peer port: %d\n" - , time_now_string(), port); + , aux::time_now_string(), port); tor1.connect_peer(tcp::endpoint(address::from_string("127.0.0.1", ec) , port)); @@ -225,7 +225,7 @@ void test_ssl(int test_idx, bool use_utp) if (i % 10 == 0) { - std::cerr << time_now_string() << " " + std::cerr << aux::time_now_string() << " " << "\033[32m" << int(st1.download_payload_rate / 1000.f) << "kB/s " << "\033[33m" << int(st1.upload_payload_rate / 1000.f) << "kB/s " << "\033[0m" << int(st1.progress * 100) << "% " @@ -270,8 +270,8 @@ void test_ssl(int test_idx, bool use_utp) fprintf(stderr, "ssl_disconnects: %d expected: %d\n", ssl_peer_disconnects, test.ssl_disconnects); TEST_EQUAL(ssl_peer_disconnects > 0, test.ssl_disconnects > 0); - fprintf(stderr, "%s: EXPECT: %s\n", time_now_string(), test.expected_to_complete ? "SUCCEESS" : "FAILURE"); - fprintf(stderr, "%s: RESULT: %s\n", time_now_string(), tor2.status().is_seeding ? "SUCCEESS" : "FAILURE"); + fprintf(stderr, "%s: EXPECT: %s\n", aux::time_now_string(), test.expected_to_complete ? "SUCCEESS" : "FAILURE"); + fprintf(stderr, "%s: RESULT: %s\n", aux::time_now_string(), tor2.status().is_seeding ? "SUCCEESS" : "FAILURE"); TEST_EQUAL(tor2.status().is_seeding, test.expected_to_complete); // this allows shutting down the sessions in parallel