From 093f966f692b61056585fb505b61ba136c9ed5cc Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 19 Feb 2019 19:04:49 -0800 Subject: [PATCH] Disable bind_continuation --- doc/qbk/release_notes.qbk | 12 +++++++++++- .../boost/beast/core/detail/bind_continuation.hpp | 14 ++++++++++++++ test/beast/core/_detail_bind_continuation.cpp | 4 ++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/doc/qbk/release_notes.qbk b/doc/qbk/release_notes.qbk index d0a955f8..6ae389e3 100644 --- a/doc/qbk/release_notes.qbk +++ b/doc/qbk/release_notes.qbk @@ -14,7 +14,15 @@ [heading Boost 1.70] [/ includes up to version 209] [/ -* Use `beast::tcp_socket` instead of `boost::asio::ip::tcp::socket`! + +* [phrase library..[@/libs/beast/ Beast]:] + * Example websocket-chat-multi + * New CppCon 2018 [@https://www.boost.org/doc/libs/master/libs/beast/doc/html/beast/examples.html#beast.examples.cppcon_2018 websocket chat example] and [@https://www.youtube.com/watch?v=7FQwAjELMek presentation video]. + * For a complete list of changes, please view the official + [@/libs/beast/doc/html/beast/release_notes.html Release Notes]. + + +* Use `beast::tcp_stream` instead of `boost::asio::ip::tcp::socket`! * subscribe to this GitHub issue to be informed! * we need testers! * star the repo! @@ -29,6 +37,8 @@ Enlarged scope - New websocket-chat-multi example ] +[/-----------------------------------------------------------------------------] + [tip The namespace alias `net` is used throughout for `boost::asio`. ] diff --git a/include/boost/beast/core/detail/bind_continuation.hpp b/include/boost/beast/core/detail/bind_continuation.hpp index 7c1befb7..def2b36d 100644 --- a/include/boost/beast/core/detail/bind_continuation.hpp +++ b/include/boost/beast/core/detail/bind_continuation.hpp @@ -21,6 +21,7 @@ namespace boost { namespace beast { namespace detail { +#if 0 /** Mark a completion handler as a continuation. This function wraps a completion handler to associate it with an @@ -86,6 +87,19 @@ bind_continuation( detail::remap_post_to_defer(ex), std::forward(handler)); } +#else +// VFALCO I turned these off at the last minute because they cause +// the completion handler to be moved before the initiating +// function is invoked rather than after, which is a foot-gun. +// +// REMINDER: Uncomment the tests when this is put back +template +F&& +bind_continuation(F&& f) +{ + return std::forward(f); +} +#endif } // detail } // beast diff --git a/test/beast/core/_detail_bind_continuation.cpp b/test/beast/core/_detail_bind_continuation.cpp index d96dbec4..971b8e53 100644 --- a/test/beast/core/_detail_bind_continuation.cpp +++ b/test/beast/core/_detail_bind_continuation.cpp @@ -10,6 +10,8 @@ // Test that header file is self-contained. #include +#if 0 + #include "test_executor.hpp" #include "test_handler.hpp" @@ -186,3 +188,5 @@ BEAST_DEFINE_TESTSUITE(beast,core,bind_continuation); } // detail } // beast } // boost + +#endif