From 45353a7f04d39cb1ae19af4f9b7f4d2f2b52ff57 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 6 Mar 2019 08:09:35 -0800 Subject: [PATCH] handler_ptr is deprecated (API Change): * `handler_ptr` is deprecated and should not be used. Actions Required: * Replace use of `handler_ptr` with `stable_async_base` and `allocate_stable`. --- CHANGELOG.md | 9 +++++++++ doc/qbk/release_notes.qbk | 5 +++++ example/echo-op/echo_op.cpp | 2 +- .../_experimental/http/impl/icy_stream.hpp | 2 +- include/boost/beast/core.hpp | 1 - include/boost/beast/core/async_base.hpp | 12 +++++------ include/boost/beast/core/detail/impl/read.hpp | 2 +- include/boost/beast/core/detect_ssl.hpp | 2 +- include/boost/beast/core/handler_ptr.hpp | 12 +++++++++++ .../boost/beast/core/impl/basic_stream.hpp | 4 ++-- .../beast/core/impl/buffered_read_stream.hpp | 2 +- include/boost/beast/core/impl/flat_stream.hpp | 2 +- include/boost/beast/core/type_traits.hpp | 7 +++---- .../boost/beast/http/impl/file_body_win32.hpp | 2 +- include/boost/beast/http/impl/read.hpp | 2 +- include/boost/beast/http/impl/write.hpp | 6 +++--- include/boost/beast/websocket/impl/accept.hpp | 20 +++++++++---------- include/boost/beast/websocket/impl/close.hpp | 4 ++-- .../boost/beast/websocket/impl/handshake.hpp | 16 +++++++-------- include/boost/beast/websocket/impl/ping.hpp | 4 ++-- include/boost/beast/websocket/impl/read.hpp | 8 ++++---- .../boost/beast/websocket/impl/teardown.hpp | 2 +- include/boost/beast/websocket/impl/write.hpp | 4 ++-- include/boost/beast/websocket/role.hpp | 2 +- test/beast/core/async_base.cpp | 16 +++++++-------- test/beast/core/handler_ptr.cpp | 7 +++++++ test/doc/core_4_layers.cpp | 4 ++-- 27 files changed, 95 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc2bbeb1..114b1f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ Version 229: * Tidy up examples * detect_ssl returns a bool +API Changes: + +* handler_ptr is deprecated + +Actions Required: + +* Replace use of `handler_ptr` with `stable_async_base` + and `allocate_stable`. + -------------------------------------------------------------------------------- Version 228: diff --git a/doc/qbk/release_notes.qbk b/doc/qbk/release_notes.qbk index 82a22b86..9b606ea8 100644 --- a/doc/qbk/release_notes.qbk +++ b/doc/qbk/release_notes.qbk @@ -197,6 +197,11 @@ in a future version. ['Actions Required]: Do not rely on the ['Fields] concept. +* `handler_ptr` is deprecated. ['Actions Required]: Use + `stable_async_base` and + `allocate_stable` + instead. + * On Windows, Visual Studio 2017 or later is required * OpenSSL is required to build the examples and tests diff --git a/example/echo-op/echo_op.cpp b/example/echo-op/echo_op.cpp index dd7890b7..36f4f712 100644 --- a/example/echo-op/echo_op.cpp +++ b/example/echo-op/echo_op.cpp @@ -304,7 +304,7 @@ async_echo( // calling the final completion handler, using post if the // first argument is false, otherwise invoking it directly. - this->invoke(cont, ec); + this->complete(cont, ec); } } }; diff --git a/include/boost/beast/_experimental/http/impl/icy_stream.hpp b/include/boost/beast/_experimental/http/impl/icy_stream.hpp index 2ea5ce1e..21abef40 100644 --- a/include/boost/beast/_experimental/http/impl/icy_stream.hpp +++ b/include/boost/beast/_experimental/http/impl/icy_stream.hpp @@ -293,7 +293,7 @@ public: } } upcall: - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } } }; diff --git a/include/boost/beast/core.hpp b/include/boost/beast/core.hpp index 0c1f5df4..edd84a40 100644 --- a/include/boost/beast/core.hpp +++ b/include/boost/beast/core.hpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/include/boost/beast/core/async_base.hpp b/include/boost/beast/core/async_base.hpp index 84047e65..b701727e 100644 --- a/include/boost/beast/core/async_base.hpp +++ b/include/boost/beast/core/async_base.hpp @@ -317,7 +317,7 @@ public: This invokes the final completion handler with the specified arguments forwarded. It is undefined to call either of - @ref invoke or @ref invoke_now more than once. + @ref complete or @ref complete_now more than once. Any temporary objects allocated with @ref beast::allocate_stable will be automatically destroyed before the final completion handler @@ -326,7 +326,7 @@ public: @param is_continuation If this value is `false`, then the handler will be submitted to the executor using `net::post`. Otherwise the handler will be invoked as if by calling - @ref invoke_now. + @ref complete_now. @param args A list of optional parameters to invoke the handler with. The completion handler must be invocable with the parameter @@ -334,7 +334,7 @@ public: */ template void - invoke(bool is_continuation, Args&&... args) + complete(bool is_continuation, Args&&... args) { this->before_invoke_hook(); if(! is_continuation) @@ -357,7 +357,7 @@ public: This invokes the final completion handler with the specified arguments forwarded. It is undefined to call either of - @ref invoke or @ref invoke_now more than once. + @ref complete or @ref complete_now more than once. Any temporary objects allocated with @ref beast::allocate_stable will be automatically destroyed before the final completion handler @@ -369,7 +369,7 @@ public: */ template void - invoke_now(Args&&... args) + complete_now(Args&&... args) { this->before_invoke_hook(); wg1_.reset(); @@ -532,7 +532,7 @@ public: } // The base class destroys the temporary data automatically, before invoking the final completion handler - this->invoke_now(ec); + this->complete_now(ec); } }; diff --git a/include/boost/beast/core/detail/impl/read.hpp b/include/boost/beast/core/detail/impl/read.hpp index 2acee883..137384aa 100644 --- a/include/boost/beast/core/detail/impl/read.hpp +++ b/include/boost/beast/core/detail/impl/read.hpp @@ -103,7 +103,7 @@ public: b_.prepare(0), std::move(*this)); ec = ec_; } - this->invoke_now(ec, total_); + this->complete_now(ec, total_); } } }; diff --git a/include/boost/beast/core/detect_ssl.hpp b/include/boost/beast/core/detect_ssl.hpp index 42db689a..17ab576a 100644 --- a/include/boost/beast/core/detect_ssl.hpp +++ b/include/boost/beast/core/detect_ssl.hpp @@ -626,7 +626,7 @@ operator()(error_code ec, std::size_t bytes_transferred, bool cont) // At this point, we are guaranteed that the original initiating // function is no longer on our stack frame. - this->invoke_now(ec, static_cast(result_)); + this->complete_now(ec, static_cast(result_)); } } diff --git a/include/boost/beast/core/handler_ptr.hpp b/include/boost/beast/core/handler_ptr.hpp index bbb9f4e9..24fd244f 100644 --- a/include/boost/beast/core/handler_ptr.hpp +++ b/include/boost/beast/core/handler_ptr.hpp @@ -13,9 +13,14 @@ #include #include #include +#include #include #include +#ifndef BOOST_BEAST_DOXYGEN + +BOOST_PRAGMA_MESSAGE(" is DEPRECATED and will be removed in a future release.") + namespace boost { namespace beast { @@ -49,6 +54,11 @@ namespace beast { template class handler_ptr { +#ifndef BOOST_BEAST_ALLOW_DEPRECATED + static_assert(sizeof(T) == 0, + BOOST_BEAST_DEPRECATION_STRING); +#endif + T* t_ = nullptr; union { @@ -215,3 +225,5 @@ public: #include #endif + +#endif diff --git a/include/boost/beast/core/impl/basic_stream.hpp b/include/boost/beast/core/impl/basic_stream.hpp index 46b55a74..c8719445 100644 --- a/include/boost/beast/core/impl/basic_stream.hpp +++ b/include/boost/beast/core/impl/basic_stream.hpp @@ -397,7 +397,7 @@ public: upcall: pg_.reset(); transfer_bytes(bytes_transferred); - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } } }; @@ -528,7 +528,7 @@ public: pg0_.reset(); pg1_.reset(); - this->invoke_now(ec, std::forward(args)...); + this->complete_now(ec, std::forward(args)...); } }; diff --git a/include/boost/beast/core/impl/buffered_read_stream.hpp b/include/boost/beast/core/impl/buffered_read_stream.hpp index 7a85cb04..18488116 100644 --- a/include/boost/beast/core/impl/buffered_read_stream.hpp +++ b/include/boost/beast/core/impl/buffered_read_stream.hpp @@ -99,7 +99,7 @@ public: s_.buffer_.consume(bytes_transferred); break; } - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/core/impl/flat_stream.hpp b/include/boost/beast/core/impl/flat_stream.hpp index 575aa7ce..29721311 100644 --- a/include/boost/beast/core/impl/flat_stream.hpp +++ b/include/boost/beast/core/impl/flat_stream.hpp @@ -71,7 +71,7 @@ public: boost::system::error_code ec, std::size_t bytes_transferred) { - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/core/type_traits.hpp b/include/boost/beast/core/type_traits.hpp index c798a554..2f423018 100644 --- a/include/boost/beast/core/type_traits.hpp +++ b/include/boost/beast/core/type_traits.hpp @@ -12,14 +12,13 @@ #ifndef BOOST_BEAST_DOXYGEN -BOOST_PRAGMA_MESSAGE(" is DEPRECATED and will be removed in a future release.") - -#include -#include +#include #include #include #include +BOOST_PRAGMA_MESSAGE(" is DEPRECATED and will be removed in a future release.") + namespace boost { namespace beast { diff --git a/include/boost/beast/http/impl/file_body_win32.hpp b/include/boost/beast/http/impl/file_body_win32.hpp index 385a4879..a7317651 100644 --- a/include/boost/beast/http/impl/file_body_win32.hpp +++ b/include/boost/beast/http/impl/file_body_win32.hpp @@ -430,7 +430,7 @@ public: BOOST_ASSERT(sr_.is_done()); } } - this->invoke_now(ec, bytes_transferred_); + this->complete_now(ec, bytes_transferred_); } }; diff --git a/include/boost/beast/http/impl/read.hpp b/include/boost/beast/http/impl/read.hpp index 51d2ea43..faea67eb 100644 --- a/include/boost/beast/http/impl/read.hpp +++ b/include/boost/beast/http/impl/read.hpp @@ -209,7 +209,7 @@ public: { if(! ec) d_.m = d_.p.release(); - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/http/impl/write.hpp b/include/boost/beast/http/impl/write.hpp index 910dcac4..5636ce92 100644 --- a/include/boost/beast/http/impl/write.hpp +++ b/include/boost/beast/http/impl/write.hpp @@ -119,7 +119,7 @@ public: { if(! ec) sr_.consume(bytes_transferred); - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } }; @@ -207,7 +207,7 @@ public: break; } upcall: - this->invoke_now(ec, bytes_transferred_); + this->complete_now(ec, bytes_transferred_); } } }; @@ -254,7 +254,7 @@ public: operator()( error_code ec, std::size_t bytes_transferred) { - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index 4c3f22ef..07843abc 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -209,7 +209,7 @@ public: boost::ignore_unused(bytes_transferred); auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -231,7 +231,7 @@ public: impl.open(role_type::server); } upcall: - this->invoke(cont, ec); + this->complete(cont, ec); } } }; @@ -287,7 +287,7 @@ public: boost::ignore_unused(bytes_transferred); auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -320,7 +320,7 @@ public: } upcall: - this->invoke(cont, ec); + this->complete(cont, ec); } } }; @@ -709,7 +709,7 @@ void stream:: accept_ex(ResponseDecorator const& decorator) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(ResponseDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -730,7 +730,7 @@ void stream:: accept_ex(ResponseDecorator const& decorator, error_code& ec) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(ResponseDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -755,7 +755,7 @@ accept_ex( ConstBufferSequence const& buffers, ResponseDecorator const &decorator) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(ResponseDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -785,7 +785,7 @@ accept_ex( ResponseDecorator const& decorator, error_code& ec) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(ResponseDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -811,7 +811,7 @@ accept_ex( http::basic_fields> const& req, ResponseDecorator const& decorator) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(ResponseDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -838,7 +838,7 @@ accept_ex( ResponseDecorator const& decorator, error_code& ec) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(ResponseDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif diff --git a/include/boost/beast/websocket/impl/close.hpp b/include/boost/beast/websocket/impl/close.hpp index 0df879f3..20c5f106 100644 --- a/include/boost/beast/websocket/impl/close.hpp +++ b/include/boost/beast/websocket/impl/close.hpp @@ -75,7 +75,7 @@ public: using beast::detail::clamp; auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -225,7 +225,7 @@ public: || impl.op_idle_ping.maybe_invoke() || impl.op_ping.maybe_invoke() || impl.op_wr.maybe_invoke(); - this->invoke(cont, ec); + this->complete(cont, ec); } } }; diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index 0ccb1102..e2036537 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -92,7 +92,7 @@ public: boost::ignore_unused(bytes_used); auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -159,7 +159,7 @@ public: swap(d_.p.get(), *res_p_); upcall: - this->invoke(cont ,ec); + this->complete(cont ,ec); } } }; @@ -382,7 +382,7 @@ handshake_ex(string_view host, string_view target, RequestDecorator const& decorator) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(RequestDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -406,7 +406,7 @@ handshake_ex(response_type& res, string_view target, RequestDecorator const& decorator) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(RequestDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -430,7 +430,7 @@ handshake_ex(string_view host, RequestDecorator const& decorator, error_code& ec) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(RequestDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -453,7 +453,7 @@ handshake_ex(response_type& res, RequestDecorator const& decorator, error_code& ec) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(RequestDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -475,7 +475,7 @@ async_handshake_ex(string_view host, RequestDecorator const& decorator, HandshakeHandler&& handler) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(RequestDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif @@ -508,7 +508,7 @@ async_handshake_ex(response_type& res, RequestDecorator const& decorator, HandshakeHandler&& handler) { -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED static_assert(sizeof(RequestDecorator) == 0, BOOST_BEAST_DEPRECATION_STRING); #endif diff --git a/include/boost/beast/websocket/impl/ping.hpp b/include/boost/beast/websocket/impl/ping.hpp index 35a314c7..c96ff34e 100644 --- a/include/boost/beast/websocket/impl/ping.hpp +++ b/include/boost/beast/websocket/impl/ping.hpp @@ -71,7 +71,7 @@ public: boost::ignore_unused(bytes_transferred); auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -102,7 +102,7 @@ public: || impl.op_idle_ping.maybe_invoke() || impl.op_rd.maybe_invoke() || impl.op_wr.maybe_invoke(); - this->invoke(cont, ec); + this->complete(cont, ec); } } }; diff --git a/include/boost/beast/websocket/impl/read.hpp b/include/boost/beast/websocket/impl/read.hpp index 809db0ec..5a5d8b1b 100644 --- a/include/boost/beast/websocket/impl/read.hpp +++ b/include/boost/beast/websocket/impl/read.hpp @@ -85,7 +85,7 @@ public: using beast::detail::clamp; auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted, 0); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -603,7 +603,7 @@ public: || impl.op_idle_ping.maybe_invoke() || impl.op_ping.maybe_invoke() || impl.op_wr.maybe_invoke(); - this->invoke(cont, ec, bytes_written_); + this->complete(cont, ec, bytes_written_); } } }; @@ -652,7 +652,7 @@ public: using beast::detail::clamp; auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted, 0); auto& impl = *sp; using mutable_buffers_type = typename @@ -680,7 +680,7 @@ public: while(! some_ && ! impl.rd_done); upcall: - this->invoke(cont, ec, bytes_written_); + this->complete(cont, ec, bytes_written_); } } }; diff --git a/include/boost/beast/websocket/impl/teardown.hpp b/include/boost/beast/websocket/impl/teardown.hpp index 8aa088bc..8e091376 100644 --- a/include/boost/beast/websocket/impl/teardown.hpp +++ b/include/boost/beast/websocket/impl/teardown.hpp @@ -120,7 +120,7 @@ public: error_code ignored; s_.non_blocking(nb_, ignored); } - this->invoke_now(ec); + this->complete_now(ec); } } }; diff --git a/include/boost/beast/websocket/impl/write.hpp b/include/boost/beast/websocket/impl/write.hpp index 9ddd6d19..c436cbf3 100644 --- a/include/boost/beast/websocket/impl/write.hpp +++ b/include/boost/beast/websocket/impl/write.hpp @@ -161,7 +161,7 @@ operator()( net::mutable_buffer b; auto sp = wp_.lock(); if(! sp) - return this->invoke(cont, + return this->complete(cont, net::error::operation_aborted, 0); auto& impl = *sp; BOOST_ASIO_CORO_REENTER(*this) @@ -426,7 +426,7 @@ operator()( || impl.op_idle_ping.maybe_invoke() || impl.op_rd.maybe_invoke() || impl.op_ping.maybe_invoke(); - this->invoke(cont, ec, bytes_transferred_); + this->complete(cont, ec, bytes_transferred_); } } diff --git a/include/boost/beast/websocket/role.hpp b/include/boost/beast/websocket/role.hpp index fdcf5b50..1efb2eb8 100644 --- a/include/boost/beast/websocket/role.hpp +++ b/include/boost/beast/websocket/role.hpp @@ -12,7 +12,7 @@ #include -#if ! BOOST_BEAST_ALLOW_DEPRECATED +#ifndef BOOST_BEAST_ALLOW_DEPRECATED #error This file is deprecated interface, #define BOOST_BEAST_ALLOW_DEPRECATED to allow it diff --git a/test/beast/core/async_base.cpp b/test/beast/core/async_base.cpp index a8f5e976..9c26039a 100644 --- a/test/beast/core/async_base.cpp +++ b/test/beast/core/async_base.cpp @@ -425,7 +425,7 @@ public: test::handler, net::io_context::executor_type> op( test::any_handler(), ioc.get_executor()); - op.invoke(true); + op.complete(true); } { net::io_context ioc; @@ -433,7 +433,7 @@ public: test::handler, net::io_context::executor_type> op( test::any_handler(), ioc.get_executor()); - op.invoke(false); + op.complete(false); ioc.run(); } { @@ -441,7 +441,7 @@ public: test::handler, simple_executor> op( test::any_handler(), {}); - op.invoke_now(); + op.complete_now(); } // legacy hooks @@ -499,7 +499,7 @@ public: test::handler, net::io_context::executor_type> op( test::any_handler(), ioc.get_executor()); - op.invoke(true); + op.complete(true); } { net::io_context ioc; @@ -507,7 +507,7 @@ public: test::handler, net::io_context::executor_type> op( test::any_handler(), ioc.get_executor()); - op.invoke(false); + op.complete(false); ioc.run(); } { @@ -515,7 +515,7 @@ public: test::handler, simple_executor> op( test::any_handler(), {}); - op.invoke_now(); + op.complete_now(); } // legacy hooks @@ -620,7 +620,7 @@ public: // `net::post` will be used to call the completion handler, otherwise // the completion handler will be invoked directly. - this->invoke(is_continuation, ec, total_bytes_transferred_); + this->complete(is_continuation, ec, total_bytes_transferred_); } }; @@ -707,7 +707,7 @@ public: } // The base class destroys the temporary data automatically, before invoking the final completion handler - this->invoke_now(ec); + this->complete_now(ec); } }; diff --git a/test/beast/core/handler_ptr.cpp b/test/beast/core/handler_ptr.cpp index 3639ba08..7db4cb47 100644 --- a/test/beast/core/handler_ptr.cpp +++ b/test/beast/core/handler_ptr.cpp @@ -7,6 +7,11 @@ // Official repository: https://github.com/boostorg/beast // +#ifdef BOOST_BEAST_ALLOW_DEPRECATED +#undef BOOST_BEAST_ALLOW_DEPRECATED +#define BOOST_BEAST_ALLOW_DEPRECATED 0 +#endif + // Test that header file is self-contained. #include @@ -121,3 +126,5 @@ BEAST_DEFINE_TESTSUITE(beast,core,handler_ptr); } // beast } // boost + +#undef BOOST_BEAST_ALLOW_DEPRECATED diff --git a/test/doc/core_4_layers.cpp b/test/doc/core_4_layers.cpp index 06cbfeea..dd6dccf7 100644 --- a/test/doc/core_4_layers.cpp +++ b/test/doc/core_4_layers.cpp @@ -110,7 +110,7 @@ class counted_stream // Count the bytes transferred towards the total stream_.bytes_read_ += bytes_transferred; - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } }; @@ -156,7 +156,7 @@ class counted_stream // Count the bytes transferred towards the total stream_.bytes_written_ += bytes_transferred; - this->invoke_now(ec, bytes_transferred); + this->complete_now(ec, bytes_transferred); } };