diff --git a/ChangeLog b/ChangeLog index 942aa8dc3..09fff0cbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -99,6 +99,10 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * fixed small memory leak in DHT + +0.15.9 release + * added some functions missing from the python binding * fixed rare piece picker bug * fixed invalid torrent_status::finished_time diff --git a/include/libtorrent/kademlia/dht_tracker.hpp b/include/libtorrent/kademlia/dht_tracker.hpp index 2a0c7458a..d0ea0a20e 100644 --- a/include/libtorrent/kademlia/dht_tracker.hpp +++ b/include/libtorrent/kademlia/dht_tracker.hpp @@ -112,7 +112,6 @@ namespace libtorrent { namespace dht void refresh_timeout(error_code const& e); void tick(error_code const& e); - void on_bootstrap(std::vector > const&); bool send_packet(libtorrent::entry& e, udp::endpoint const& addr, int send_flags); node_impl m_dht; diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 53712b467..5f74165c6 100644 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -3161,7 +3161,9 @@ namespace libtorrent { char hex_pid[41]; to_hex(recv_buffer.begin, 20, hex_pid); + hex_pid[40] = 0; char ascii_pid[21]; + ascii_pid[20] = 0; for (int i = 0; i != 20; ++i) { if (is_print(recv_buffer.begin[i])) ascii_pid[i] = recv_buffer.begin[i]; diff --git a/src/kademlia/dht_tracker.cpp b/src/kademlia/dht_tracker.cpp index 493492975..2e2011326 100644 --- a/src/kademlia/dht_tracker.cpp +++ b/src/kademlia/dht_tracker.cpp @@ -250,6 +250,9 @@ namespace libtorrent { namespace dht #endif } + // defined in node.cpp + extern void nop(); + void dht_tracker::start(entry const& bootstrap) { TORRENT_ASSERT(m_ses.is_network_thread()); @@ -273,7 +276,7 @@ namespace libtorrent { namespace dht m_refresh_timer.expires_from_now(seconds(5), ec); m_refresh_timer.async_wait(boost::bind(&dht_tracker::refresh_timeout, self(), _1)); - m_dht.bootstrap(initial_nodes, boost::bind(&dht_tracker::on_bootstrap, self(), _1)); + m_dht.bootstrap(initial_nodes, boost::bind(&libtorrent::dht::nop)); } void dht_tracker::stop() @@ -607,11 +610,6 @@ namespace libtorrent { namespace dht m_dht.add_router_node(node); } - void dht_tracker::on_bootstrap(std::vector > const&) - { - // #error post an alert - } - bool dht_tracker::send_packet(libtorrent::entry& e, udp::endpoint const& addr, int send_flags) { TORRENT_ASSERT(m_ses.is_network_thread());