mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 21:07:26 +02:00
Fix completion handler invocation signatures
Completion handlers should be called with the exact same signature as provided to `async_result`. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
committed by
Vinnie Falco
parent
fdf64a4550
commit
b9aad3d06c
@ -2,6 +2,7 @@ Version 230:
|
||||
|
||||
* Don't use dynamic_buffer_ref
|
||||
* Remove dynamic_buffer_ref
|
||||
* Fix completion handler invocation signatures
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -195,7 +195,7 @@ public:
|
||||
std::forward<Handler_>(h),
|
||||
sp->stream().get_executor())
|
||||
, wp_(sp)
|
||||
, res_(beast::allocate_stable<response_type>(*this,
|
||||
, res_(beast::allocate_stable<response_type>(*this,
|
||||
sp->build_response(req, decorator, result_)))
|
||||
{
|
||||
(*this)({}, 0, cont);
|
||||
@ -209,8 +209,10 @@ public:
|
||||
boost::ignore_unused(bytes_transferred);
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
return this->complete(cont, ec);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
@ -287,8 +289,10 @@ public:
|
||||
boost::ignore_unused(bytes_transferred);
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
return this->complete(cont, ec);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
@ -306,7 +310,7 @@ public:
|
||||
ec = error::closed;
|
||||
if(impl.check_stop_now(ec))
|
||||
goto upcall;
|
||||
|
||||
|
||||
{
|
||||
// Arguments from our state must be
|
||||
// moved to the stack before releasing
|
||||
|
@ -75,8 +75,10 @@ public:
|
||||
using beast::detail::clamp;
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
return this->complete(cont, ec);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
|
@ -92,8 +92,10 @@ public:
|
||||
boost::ignore_unused(bytes_used);
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
return this->complete(cont, ec);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
|
@ -71,8 +71,10 @@ public:
|
||||
boost::ignore_unused(bytes_transferred);
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
return this->complete(cont, ec);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
|
@ -85,8 +85,11 @@ public:
|
||||
using beast::detail::clamp;
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted, 0);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
bytes_written_ = 0;
|
||||
return this->complete(cont, ec, bytes_written_);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
@ -652,8 +655,11 @@ public:
|
||||
using beast::detail::clamp;
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted, 0);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
bytes_written_ = 0;
|
||||
return this->complete(cont, ec, bytes_written_);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
using mutable_buffers_type = typename
|
||||
DynamicBuffer::mutable_buffers_type;
|
||||
|
@ -161,8 +161,11 @@ operator()(
|
||||
net::mutable_buffer b;
|
||||
auto sp = wp_.lock();
|
||||
if(! sp)
|
||||
return this->complete(cont,
|
||||
net::error::operation_aborted, 0);
|
||||
{
|
||||
ec = net::error::operation_aborted;
|
||||
bytes_transferred_ = 0;
|
||||
return this->complete(cont, ec, bytes_transferred_);
|
||||
}
|
||||
auto& impl = *sp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
|
Reference in New Issue
Block a user