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
|
* Don't use dynamic_buffer_ref
|
||||||
* Remove dynamic_buffer_ref
|
* Remove dynamic_buffer_ref
|
||||||
|
* Fix completion handler invocation signatures
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ public:
|
|||||||
std::forward<Handler_>(h),
|
std::forward<Handler_>(h),
|
||||||
sp->stream().get_executor())
|
sp->stream().get_executor())
|
||||||
, wp_(sp)
|
, wp_(sp)
|
||||||
, res_(beast::allocate_stable<response_type>(*this,
|
, res_(beast::allocate_stable<response_type>(*this,
|
||||||
sp->build_response(req, decorator, result_)))
|
sp->build_response(req, decorator, result_)))
|
||||||
{
|
{
|
||||||
(*this)({}, 0, cont);
|
(*this)({}, 0, cont);
|
||||||
@ -209,8 +209,10 @@ public:
|
|||||||
boost::ignore_unused(bytes_transferred);
|
boost::ignore_unused(bytes_transferred);
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
if(! sp)
|
||||||
return this->complete(cont,
|
{
|
||||||
net::error::operation_aborted);
|
ec = net::error::operation_aborted;
|
||||||
|
return this->complete(cont, ec);
|
||||||
|
}
|
||||||
auto& impl = *sp;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
@ -287,8 +289,10 @@ public:
|
|||||||
boost::ignore_unused(bytes_transferred);
|
boost::ignore_unused(bytes_transferred);
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
if(! sp)
|
||||||
return this->complete(cont,
|
{
|
||||||
net::error::operation_aborted);
|
ec = net::error::operation_aborted;
|
||||||
|
return this->complete(cont, ec);
|
||||||
|
}
|
||||||
auto& impl = *sp;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
@ -306,7 +310,7 @@ public:
|
|||||||
ec = error::closed;
|
ec = error::closed;
|
||||||
if(impl.check_stop_now(ec))
|
if(impl.check_stop_now(ec))
|
||||||
goto upcall;
|
goto upcall;
|
||||||
|
|
||||||
{
|
{
|
||||||
// Arguments from our state must be
|
// Arguments from our state must be
|
||||||
// moved to the stack before releasing
|
// moved to the stack before releasing
|
||||||
|
@ -75,8 +75,10 @@ public:
|
|||||||
using beast::detail::clamp;
|
using beast::detail::clamp;
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
if(! sp)
|
||||||
return this->complete(cont,
|
{
|
||||||
net::error::operation_aborted);
|
ec = net::error::operation_aborted;
|
||||||
|
return this->complete(cont, ec);
|
||||||
|
}
|
||||||
auto& impl = *sp;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
|
@ -92,8 +92,10 @@ public:
|
|||||||
boost::ignore_unused(bytes_used);
|
boost::ignore_unused(bytes_used);
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
if(! sp)
|
||||||
return this->complete(cont,
|
{
|
||||||
net::error::operation_aborted);
|
ec = net::error::operation_aborted;
|
||||||
|
return this->complete(cont, ec);
|
||||||
|
}
|
||||||
auto& impl = *sp;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
|
@ -71,8 +71,10 @@ public:
|
|||||||
boost::ignore_unused(bytes_transferred);
|
boost::ignore_unused(bytes_transferred);
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
if(! sp)
|
||||||
return this->complete(cont,
|
{
|
||||||
net::error::operation_aborted);
|
ec = net::error::operation_aborted;
|
||||||
|
return this->complete(cont, ec);
|
||||||
|
}
|
||||||
auto& impl = *sp;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
|
@ -85,8 +85,11 @@ public:
|
|||||||
using beast::detail::clamp;
|
using beast::detail::clamp;
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
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;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
@ -652,8 +655,11 @@ public:
|
|||||||
using beast::detail::clamp;
|
using beast::detail::clamp;
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
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;
|
auto& impl = *sp;
|
||||||
using mutable_buffers_type = typename
|
using mutable_buffers_type = typename
|
||||||
DynamicBuffer::mutable_buffers_type;
|
DynamicBuffer::mutable_buffers_type;
|
||||||
|
@ -161,8 +161,11 @@ operator()(
|
|||||||
net::mutable_buffer b;
|
net::mutable_buffer b;
|
||||||
auto sp = wp_.lock();
|
auto sp = wp_.lock();
|
||||||
if(! sp)
|
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;
|
auto& impl = *sp;
|
||||||
BOOST_ASIO_CORO_REENTER(*this)
|
BOOST_ASIO_CORO_REENTER(*this)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user