diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ac224f..1943e0da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Version 259: * Move `char_buffer` into a separate file * Fix coverage collection in AzP CI * Improve performance of `http::string_to_verb` +* Replace uses of `net::coroutine` with `asio::coroutine` -------------------------------------------------------------------------------- diff --git a/example/echo-op/echo_op.cpp b/example/echo-op/echo_op.cpp index 36f4f712..7ace0818 100644 --- a/example/echo-op/echo_op.cpp +++ b/example/echo-op/echo_op.cpp @@ -41,7 +41,7 @@ async_echo (AsyncStream& stream, DynamicBuffer& buffer, CompletionToken&& token) This function is used to asynchronously read a line ending in a newline (`"\n"`) from the stream, and then write it back. - + This call always returns immediately. The asynchronous operation will continue until one of the following conditions is true: @@ -76,7 +76,7 @@ async_echo (AsyncStream& stream, DynamicBuffer& buffer, CompletionToken&& token) beast::error_code error // Result of operation. ); @endcode - + Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using @@ -161,10 +161,10 @@ async_echo( // This nested class implements the echo composed operation as a // stateful completion handler. We derive from `async_base` to - // take care of boilerplate and we derived from net::coroutine to + // take care of boilerplate and we derived from asio::coroutine to // allow the reenter and yield keywords to work. - struct echo_op : base_type, net::coroutine + struct echo_op : base_type, boost::asio::coroutine { AsyncStream& stream_; DynamicBuffer& buffer_; diff --git a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp index 17568d53..06c0e361 100644 --- a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp +++ b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp @@ -238,7 +238,7 @@ fail(beast::error_code ec, char const* what) // Handles an HTTP server connection class session - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { // This is the C++11 equivalent of a generic lambda. @@ -398,7 +398,7 @@ public: // Accepts incoming connections and launches the sessions class listener - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { net::io_context& ioc_; diff --git a/example/http/server/stackless/http_server_stackless.cpp b/example/http/server/stackless/http_server_stackless.cpp index eb17f4af..f0c78160 100644 --- a/example/http/server/stackless/http_server_stackless.cpp +++ b/example/http/server/stackless/http_server_stackless.cpp @@ -214,7 +214,7 @@ fail(beast::error_code ec, char const* what) // Handles an HTTP server connection class session - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { // This is the C++11 equivalent of a generic lambda. @@ -344,7 +344,7 @@ public: // Accepts incoming connections and launches the sessions class listener - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { net::io_context& ioc_; @@ -407,7 +407,7 @@ public: private: #include - + void loop(beast::error_code ec = {}) { diff --git a/example/websocket/server/stackless-ssl/websocket_server_stackless_ssl.cpp b/example/websocket/server/stackless-ssl/websocket_server_stackless_ssl.cpp index 0ddd0d3a..88073054 100644 --- a/example/websocket/server/stackless-ssl/websocket_server_stackless_ssl.cpp +++ b/example/websocket/server/stackless-ssl/websocket_server_stackless_ssl.cpp @@ -48,7 +48,7 @@ fail(beast::error_code ec, char const* what) // Echoes back all received WebSocket messages class session - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { websocket::stream> ws_; @@ -164,7 +164,7 @@ public: // Accepts incoming connections and launches the sessions class listener - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { net::io_context& ioc_; diff --git a/example/websocket/server/stackless/websocket_server_stackless.cpp b/example/websocket/server/stackless/websocket_server_stackless.cpp index c0677d15..ab44b0ee 100644 --- a/example/websocket/server/stackless/websocket_server_stackless.cpp +++ b/example/websocket/server/stackless/websocket_server_stackless.cpp @@ -43,7 +43,7 @@ fail(beast::error_code ec, char const* what) // Echoes back all received WebSocket messages class session - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { websocket::stream ws_; @@ -65,7 +65,7 @@ public: } #include - + void loop( beast::error_code ec, @@ -141,7 +141,7 @@ public: // Accepts incoming connections and launches the sessions class listener - : public net::coroutine + : public boost::asio::coroutine , public std::enable_shared_from_this { net::io_context& ioc_; @@ -202,7 +202,7 @@ public: private: #include - + void loop(beast::error_code ec = {}) { diff --git a/include/boost/beast/_experimental/http/impl/icy_stream.hpp b/include/boost/beast/_experimental/http/impl/icy_stream.hpp index f7329180..9b6e66ab 100644 --- a/include/boost/beast/_experimental/http/impl/icy_stream.hpp +++ b/include/boost/beast/_experimental/http/impl/icy_stream.hpp @@ -35,7 +35,7 @@ is_icy(ConstBufferSequence const& buffers) char buf[3]; auto const n = net::buffer_copy( net::mutable_buffer(buf, 3), - buffers); + buffers); if(n >= 1 && buf[0] != 'I') return false; if(n >= 2 && buf[1] != 'C') @@ -57,7 +57,7 @@ template class read_op : public beast::async_base> - , public net::coroutine + , public asio::coroutine { icy_stream& s_; Buffers b_; diff --git a/include/boost/beast/core/detail/impl/read.hpp b/include/boost/beast/core/detail/impl/read.hpp index 137384aa..c0e997ae 100644 --- a/include/boost/beast/core/detail/impl/read.hpp +++ b/include/boost/beast/core/detail/impl/read.hpp @@ -37,7 +37,7 @@ template< class Condition, class Handler> class read_op - : public net::coroutine + : public asio::coroutine , public async_base< Handler, beast::executor_type> { diff --git a/include/boost/beast/http/impl/read.hpp b/include/boost/beast/http/impl/read.hpp index e5f55f16..ba265a57 100644 --- a/include/boost/beast/http/impl/read.hpp +++ b/include/boost/beast/http/impl/read.hpp @@ -164,7 +164,7 @@ template< class read_msg_op : public beast::stable_async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { using parser_type = parser; diff --git a/include/boost/beast/http/impl/write.hpp b/include/boost/beast/http/impl/write.hpp index 02363bad..251ba7f8 100644 --- a/include/boost/beast/http/impl/write.hpp +++ b/include/boost/beast/http/impl/write.hpp @@ -159,7 +159,7 @@ template< class write_op : public beast::async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { Stream& s_; serializer& sr_; diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index 46c2e0c2..5402ded0 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -167,7 +167,7 @@ template class stream::response_op : public beast::stable_async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { boost::weak_ptr wp_; error_code result_; // must come before res_ @@ -242,7 +242,7 @@ template class stream::accept_op : public beast::stable_async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { boost::weak_ptr wp_; http::request_parser& p_; diff --git a/include/boost/beast/websocket/impl/close.hpp b/include/boost/beast/websocket/impl/close.hpp index 03078d92..d59374cc 100644 --- a/include/boost/beast/websocket/impl/close.hpp +++ b/include/boost/beast/websocket/impl/close.hpp @@ -38,7 +38,7 @@ template class stream::close_op : public beast::stable_async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { boost::weak_ptr wp_; error_code ev_; diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index 21fba997..645b1a3a 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -37,7 +37,7 @@ template class stream::handshake_op : public beast::stable_async_base> - , public net::coroutine + , public asio::coroutine { struct data { diff --git a/include/boost/beast/websocket/impl/ping.hpp b/include/boost/beast/websocket/impl/ping.hpp index 917cfc32..6f92d7c7 100644 --- a/include/boost/beast/websocket/impl/ping.hpp +++ b/include/boost/beast/websocket/impl/ping.hpp @@ -35,7 +35,7 @@ template class stream::ping_op : public beast::stable_async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { boost::weak_ptr wp_; detail::frame_buffer& fb_; @@ -115,7 +115,7 @@ public: template template class stream::idle_ping_op - : public net::coroutine + : public asio::coroutine , public boost::empty_value { boost::weak_ptr wp_; diff --git a/include/boost/beast/websocket/impl/read.hpp b/include/boost/beast/websocket/impl/read.hpp index 96edf845..86c8940f 100644 --- a/include/boost/beast/websocket/impl/read.hpp +++ b/include/boost/beast/websocket/impl/read.hpp @@ -48,7 +48,7 @@ template class stream::read_some_op : public beast::async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { boost::weak_ptr wp_; MutableBufferSequence bs_; @@ -619,7 +619,7 @@ template class stream::read_op : public beast::async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { boost::weak_ptr wp_; DynamicBuffer& b_; diff --git a/include/boost/beast/websocket/impl/teardown.hpp b/include/boost/beast/websocket/impl/teardown.hpp index 8e091376..1ef28353 100644 --- a/include/boost/beast/websocket/impl/teardown.hpp +++ b/include/boost/beast/websocket/impl/teardown.hpp @@ -33,7 +33,7 @@ class teardown_tcp_op Handler, beast::executor_type< net::basic_stream_socket< Protocol, Executor>>> - , public net::coroutine + , public asio::coroutine { using socket_type = net::basic_stream_socket; diff --git a/include/boost/beast/websocket/impl/write.hpp b/include/boost/beast/websocket/impl/write.hpp index 318693f5..2a82b677 100644 --- a/include/boost/beast/websocket/impl/write.hpp +++ b/include/boost/beast/websocket/impl/write.hpp @@ -41,7 +41,7 @@ template class stream::write_some_op : public beast::async_base< Handler, beast::executor_type> - , public net::coroutine + , public asio::coroutine { enum {