diff --git a/include/libtorrent/aux_/allocating_handler.hpp b/include/libtorrent/aux_/allocating_handler.hpp index 7521f3f18..82a162d9e 100644 --- a/include/libtorrent/aux_/allocating_handler.hpp +++ b/include/libtorrent/aux_/allocating_handler.hpp @@ -1,6 +1,6 @@ /* -Copyright (c) 2015, Arvid Norberg, Daniel Wallin +Copyright (c) 2015, Arvid Norberg All rights reserved. Redistribution and use in source and binary forms, with or without @@ -97,11 +97,6 @@ namespace libtorrent { namespace aux handler(std::forward(a)...); } #else - void operator()() const - { - handler(); - } - template void operator()(A0 const& a0) const { diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 7fcbeef76..8dac3e8bd 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -983,7 +983,7 @@ namespace libtorrent // have sent to it int m_outstanding_bytes; - // TODO: 3 use handler storage for second_tick too + // TODO: 3 use handler storage for second_tick and udp_packet handler too aux::handler_storage m_read_handler_storage; aux::handler_storage m_write_handler_storage; diff --git a/include/libtorrent/udp_socket.hpp b/include/libtorrent/udp_socket.hpp index 7ffe963cf..cb3c47c2a 100644 --- a/include/libtorrent/udp_socket.hpp +++ b/include/libtorrent/udp_socket.hpp @@ -41,7 +41,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/thread.hpp" #include "libtorrent/deadline_timer.hpp" #include "libtorrent/debug.hpp" -#include "libtorrent/aux_/allocating_handler.hpp" #include @@ -176,29 +175,6 @@ namespace libtorrent udp_socket(udp_socket const&); udp_socket& operator=(udp_socket const&); - template - aux::allocating_handler - make_read_handler(udp::socket* s, Handler const& handler) - { -#if TORRENT_USE_IPV6 - if (s == &m_ipv6_sock) - { - return aux::allocating_handler( - handler, m_read6_handler_storage); - } - else -#endif - { - return aux::allocating_handler( - handler, m_read4_handler_storage); - } - } - - aux::handler_storage m_read4_handler_storage; -#if TORRENT_USE_IPV6 - aux::handler_storage m_read6_handler_storage; -#endif - // observers on this udp socket std::vector m_observers; std::vector m_added_observers; diff --git a/src/udp_socket.cpp b/src/udp_socket.cpp index 041525d29..d8453b3f0 100644 --- a/src/udp_socket.cpp +++ b/src/udp_socket.cpp @@ -501,7 +501,7 @@ void udp_socket::setup_read(udp::socket* s) TORRENT_TRY { s->async_receive_from(null_buffers() - , ep, make_read_handler(s, boost::bind(&udp_socket::on_read, this, _1, s))); + , ep, boost::bind(&udp_socket::on_read, this, _1, s)); } TORRENT_CATCH(boost::system::system_error& e) { @@ -510,8 +510,8 @@ void udp_socket::setup_read(udp::socket* s) error_code ec; boost::system::system_error e(ec); #endif - get_io_service().post(make_read_handler(s, boost::bind(&udp_socket::on_read - , this, e.code(), s))); + get_io_service().post(boost::bind(&udp_socket::on_read + , this, e.code(), s)); } }