mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 23:04:35 +02:00
Tidy up calls to post()
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
Version 163:
|
||||||
|
|
||||||
|
* Tidy up calls to post()
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 162:
|
Version 162:
|
||||||
|
|
||||||
* Add asio_handler_invoke overloads for stream algorithms
|
* Add asio_handler_invoke overloads for stream algorithms
|
||||||
|
@@ -413,7 +413,6 @@ operator()(boost::beast::error_code ec, std::size_t bytes_transferred)
|
|||||||
// original handler.
|
// original handler.
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(
|
||||||
stream_.get_executor(),
|
|
||||||
beast::bind_handler(std::move(*this), ec, 0));
|
beast::bind_handler(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -121,7 +121,6 @@ read_some_op<MutableBufferSequence, Handler>::operator()(
|
|||||||
}
|
}
|
||||||
step_ = 3;
|
step_ = 3;
|
||||||
return boost::asio::post(
|
return boost::asio::post(
|
||||||
s_.get_executor(),
|
|
||||||
bind_handler(std::move(*this), ec, 0));
|
bind_handler(std::move(*this), ec, 0));
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
|
@@ -170,10 +170,11 @@ operator()(
|
|||||||
|
|
||||||
upcall:
|
upcall:
|
||||||
if(! cont_)
|
if(! cont_)
|
||||||
return boost::asio::post(
|
{
|
||||||
s_.get_executor(),
|
BOOST_ASIO_CORO_YIELD
|
||||||
bind_handler(std::move(h_),
|
boost::asio::post(
|
||||||
ec, bytes_transferred_));
|
bind_handler(std::move(*this), ec));
|
||||||
|
}
|
||||||
h_(ec, bytes_transferred_);
|
h_(ec, bytes_transferred_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,7 +291,7 @@ operator()(
|
|||||||
if(Condition{}(p_))
|
if(Condition{}(p_))
|
||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(s_.get_executor(),
|
boost::asio::post(
|
||||||
bind_handler(std::move(*this), ec));
|
bind_handler(std::move(*this), ec));
|
||||||
goto upcall;
|
goto upcall;
|
||||||
}
|
}
|
||||||
|
@@ -140,7 +140,6 @@ operator()()
|
|||||||
{
|
{
|
||||||
BOOST_ASSERT(! f.invoked);
|
BOOST_ASSERT(! f.invoked);
|
||||||
return boost::asio::post(
|
return boost::asio::post(
|
||||||
s_.get_executor(),
|
|
||||||
bind_handler(std::move(*this), ec, 0));
|
bind_handler(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
if(f.invoked)
|
if(f.invoked)
|
||||||
@@ -153,7 +152,6 @@ operator()()
|
|||||||
BOOST_ASSERT(sr_.is_done());
|
BOOST_ASSERT(sr_.is_done());
|
||||||
}
|
}
|
||||||
return boost::asio::post(
|
return boost::asio::post(
|
||||||
s_.get_executor(),
|
|
||||||
bind_handler(std::move(*this), ec, 0));
|
bind_handler(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,7 +282,6 @@ operator()(
|
|||||||
{
|
{
|
||||||
state_ = 1;
|
state_ = 1;
|
||||||
return boost::asio::post(
|
return boost::asio::post(
|
||||||
s_.get_executor(),
|
|
||||||
bind_handler(std::move(*this), ec, 0));
|
bind_handler(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
state_ = 2;
|
state_ = 2;
|
||||||
|
@@ -265,7 +265,6 @@ operator()(error_code ec, std::size_t)
|
|||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(
|
||||||
d.ws.get_executor(),
|
|
||||||
bind_handler(std::move(*this), ec));
|
bind_handler(std::move(*this), ec));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -152,8 +152,7 @@ operator()(
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
d.ws.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
||||||
|
|
||||||
// Make sure the stream is open
|
// Make sure the stream is open
|
||||||
@@ -196,8 +195,7 @@ operator()(
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
d.ws.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(d.ws.rd_block_.is_locked(this));
|
BOOST_ASSERT(d.ws.rd_block_.is_locked(this));
|
||||||
|
|
||||||
// Make sure the stream is open
|
// Make sure the stream is open
|
||||||
@@ -303,10 +301,9 @@ operator()(
|
|||||||
d.ws.paused_wr_.maybe_invoke();
|
d.ws.paused_wr_.maybe_invoke();
|
||||||
if(! d.cont)
|
if(! d.cont)
|
||||||
{
|
{
|
||||||
auto& ws = d.ws;
|
BOOST_ASIO_CORO_YIELD
|
||||||
return boost::asio::post(
|
boost::asio::post(
|
||||||
ws.stream_.get_executor(),
|
bind_handler(std::move(*this), ec));
|
||||||
bind_handler(d_.release_handler(), ec));
|
|
||||||
}
|
}
|
||||||
d_.invoke(ec);
|
d_.invoke(ec);
|
||||||
}
|
}
|
||||||
|
@@ -135,7 +135,6 @@ operator()(error_code ec, std::size_t)
|
|||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(
|
||||||
d.ws.get_executor(),
|
|
||||||
bind_handler(std::move(*this), ec));
|
bind_handler(std::move(*this), ec));
|
||||||
goto upcall;
|
goto upcall;
|
||||||
}
|
}
|
||||||
@@ -151,8 +150,7 @@ operator()(error_code ec, std::size_t)
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
d.ws.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
||||||
|
|
||||||
// Make sure the stream is open
|
// Make sure the stream is open
|
||||||
|
@@ -196,8 +196,7 @@ operator()(
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(ws_.rd_block_.is_locked(this));
|
BOOST_ASSERT(ws_.rd_block_.is_locked(this));
|
||||||
|
|
||||||
// The only way to get read blocked is if
|
// The only way to get read blocked is if
|
||||||
@@ -278,9 +277,7 @@ operator()(
|
|||||||
if(! cont_)
|
if(! cont_)
|
||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(),
|
|
||||||
std::move(*this));
|
|
||||||
BOOST_ASSERT(cont_);
|
BOOST_ASSERT(cont_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,8 +319,7 @@ operator()(
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||||
|
|
||||||
// Make sure the stream is open
|
// Make sure the stream is open
|
||||||
@@ -354,9 +350,7 @@ operator()(
|
|||||||
if(! cont_)
|
if(! cont_)
|
||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(),
|
|
||||||
std::move(*this));
|
|
||||||
BOOST_ASSERT(cont_);
|
BOOST_ASSERT(cont_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,9 +374,7 @@ operator()(
|
|||||||
if(! cont_)
|
if(! cont_)
|
||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(),
|
|
||||||
std::move(*this));
|
|
||||||
BOOST_ASSERT(cont_);
|
BOOST_ASSERT(cont_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -638,8 +630,7 @@ operator()(
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||||
|
|
||||||
// Make sure the stream is open
|
// Make sure the stream is open
|
||||||
@@ -700,10 +691,11 @@ operator()(
|
|||||||
ws_.paused_ping_.maybe_invoke() ||
|
ws_.paused_ping_.maybe_invoke() ||
|
||||||
ws_.paused_wr_.maybe_invoke();
|
ws_.paused_wr_.maybe_invoke();
|
||||||
if(! cont_)
|
if(! cont_)
|
||||||
return boost::asio::post(
|
{
|
||||||
ws_.stream_.get_executor(),
|
BOOST_ASIO_CORO_YIELD
|
||||||
bind_handler(std::move(h_),
|
boost::asio::post(
|
||||||
ec, bytes_written_));
|
bind_handler(std::move(*this), ec));
|
||||||
|
}
|
||||||
h_(ec, bytes_written_);
|
h_(ec, bytes_written_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -814,9 +806,8 @@ operator()(
|
|||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(
|
||||||
ws_.get_executor(),
|
|
||||||
bind_handler(std::move(*this),
|
bind_handler(std::move(*this),
|
||||||
error::buffer_overflow, 0));
|
error::buffer_overflow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
|
@@ -113,8 +113,7 @@ operator()(error_code ec, std::size_t bytes_transferred)
|
|||||||
{
|
{
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(
|
||||||
s_.get_executor(),
|
bind_handler(std::move(*this), ec));
|
||||||
bind_handler(std::move(*this), ec, 0));
|
|
||||||
goto upcall;
|
goto upcall;
|
||||||
}
|
}
|
||||||
for(;;)
|
for(;;)
|
||||||
|
@@ -321,8 +321,7 @@ operator()(
|
|||||||
|
|
||||||
// Resume
|
// Resume
|
||||||
BOOST_ASIO_CORO_YIELD
|
BOOST_ASIO_CORO_YIELD
|
||||||
boost::asio::post(
|
boost::asio::post(std::move(*this));
|
||||||
ws_.get_executor(), std::move(*this));
|
|
||||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||||
|
|
||||||
// Make sure the stream is open
|
// Make sure the stream is open
|
||||||
@@ -569,9 +568,11 @@ operator()(
|
|||||||
ws_.paused_rd_.maybe_invoke() ||
|
ws_.paused_rd_.maybe_invoke() ||
|
||||||
ws_.paused_ping_.maybe_invoke();
|
ws_.paused_ping_.maybe_invoke();
|
||||||
if(! cont_)
|
if(! cont_)
|
||||||
return boost::asio::post(
|
{
|
||||||
ws_.stream_.get_executor(),
|
BOOST_ASIO_CORO_YIELD
|
||||||
bind_handler(std::move(h_), ec, bytes_transferred_));
|
boost::asio::post(
|
||||||
|
bind_handler(std::move(*this), ec));
|
||||||
|
}
|
||||||
h_(ec, bytes_transferred_);
|
h_(ec, bytes_transferred_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user