diff options
Diffstat (limited to 'boost/asio/detail/win_iocp_socket_send_op.hpp')
-rw-r--r-- | boost/asio/detail/win_iocp_socket_send_op.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/boost/asio/detail/win_iocp_socket_send_op.hpp b/boost/asio/detail/win_iocp_socket_send_op.hpp index c9abc0e664..48951c2508 100644 --- a/boost/asio/detail/win_iocp_socket_send_op.hpp +++ b/boost/asio/detail/win_iocp_socket_send_op.hpp @@ -19,12 +19,12 @@ #if defined(BOOST_ASIO_HAS_IOCP) -#include <boost/asio/detail/addressof.hpp> #include <boost/asio/detail/bind_handler.hpp> #include <boost/asio/detail/buffer_sequence_adapter.hpp> #include <boost/asio/detail/fenced_block.hpp> #include <boost/asio/detail/handler_alloc_helpers.hpp> #include <boost/asio/detail/handler_invoke_helpers.hpp> +#include <boost/asio/detail/memory.hpp> #include <boost/asio/detail/operation.hpp> #include <boost/asio/detail/socket_ops.hpp> #include <boost/asio/error.hpp> @@ -48,9 +48,10 @@ public: buffers_(buffers), handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)) { + handler_work<Handler>::start(handler_); } - static void do_complete(io_service_impl* owner, operation* base, + static void do_complete(void* owner, operation* base, const boost::system::error_code& result_ec, std::size_t bytes_transferred) { @@ -59,8 +60,9 @@ public: // Take ownership of the operation object. win_iocp_socket_send_op* o(static_cast<win_iocp_socket_send_op*>(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; + handler_work<Handler> w(o->handler_); - BOOST_ASIO_HANDLER_COMPLETION((o)); + BOOST_ASIO_HANDLER_COMPLETION((*o)); #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING) // Check whether buffers are still valid. @@ -89,7 +91,7 @@ public: { fenced_block b(fenced_block::half); BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); - boost_asio_handler_invoke_helpers::invoke(handler, handler.handler_); + w.complete(handler, handler.handler_); BOOST_ASIO_HANDLER_INVOCATION_END; } } |