diff --git a/include/boost/http_io/detail/except.hpp b/include/boost/http_io/detail/except.hpp index de84ec9..f8d9bae 100644 --- a/include/boost/http_io/detail/except.hpp +++ b/include/boost/http_io/detail/except.hpp @@ -11,6 +11,7 @@ #define BOOST_HTTP_IO_DETAIL_EXCEPT_HPP #include +#include namespace boost { namespace http_io { diff --git a/include/boost/http_io/impl/read.hpp b/include/boost/http_io/impl/read.hpp index 7096ff7..9155f01 100644 --- a/include/boost/http_io/impl/read.hpp +++ b/include/boost/http_io/impl/read.hpp @@ -16,9 +16,8 @@ #include #include #include -#include +#include #include -#include namespace boost { namespace http_io { @@ -57,13 +56,9 @@ class read_header_op { BOOST_ASIO_HANDLER_LOCATION(( __FILE__, __LINE__, - "post")); - asio::post( - stream_.get_executor(), - asio::append( - std::move(self), - ec, - 0)); + "immediate")); + asio::async_immediate( + self.get_io_executor(), std::move(self)); } goto upcall; } @@ -145,13 +140,9 @@ class read_body_op { BOOST_ASIO_HANDLER_LOCATION(( __FILE__, __LINE__, - "post")); - asio::post( - stream_.get_executor(), - asio::append( - std::move(self), - ec, - 0)); + "immediate")); + asio::async_immediate( + self.get_io_executor(), asio::append(std::move(self), ec)); } goto upcall; } diff --git a/include/boost/http_io/impl/write.hpp b/include/boost/http_io/impl/write.hpp index 238ff84..ec77ae0 100644 --- a/include/boost/http_io/impl/write.hpp +++ b/include/boost/http_io/impl/write.hpp @@ -14,10 +14,10 @@ #include #include #include -#include +#include #include #include -#include +#include namespace boost { namespace http_io { @@ -43,20 +43,12 @@ class write_some_op { } - template - void - operator()(Self& self) - { - (*this)(self, {}, 0, true); - } - template void operator()( Self& self, - system::error_code ec, - std::size_t bytes_transferred, - bool do_post = false) + system::error_code ec = {}, + std::size_t bytes_transferred = {}) { system::result rv; @@ -66,19 +58,13 @@ class write_some_op if(! rv) { ec = rv.error(); - if(! do_post) - goto upcall; BOOST_ASIO_CORO_YIELD { BOOST_ASIO_HANDLER_LOCATION(( __FILE__, __LINE__, "http_io::write_some_op")); - asio::post( - dest_.get_executor(), - asio::append( - std::move(self), - ec, - bytes_transferred)); + asio::async_immediate( + self.get_io_executor(), asio::append(std::move(self), ec)); } goto upcall; }