mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 04:47:29 +02:00
net::prepend is replaced with net::append
This commit is contained in:
committed by
Mohammad Nejati
parent
dadd1bc785
commit
aabd5b51d3
@ -13,12 +13,11 @@
|
|||||||
#include <boost/beast/core/buffer_traits.hpp>
|
#include <boost/beast/core/buffer_traits.hpp>
|
||||||
#include <boost/beast/core/detail/service_base.hpp>
|
#include <boost/beast/core/detail/service_base.hpp>
|
||||||
#include <boost/beast/core/detail/is_invocable.hpp>
|
#include <boost/beast/core/detail/is_invocable.hpp>
|
||||||
#include <boost/asio/associated_cancellation_slot.hpp>
|
|
||||||
#include <boost/asio/any_io_executor.hpp>
|
#include <boost/asio/any_io_executor.hpp>
|
||||||
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/associated_cancellation_slot.hpp>
|
#include <boost/asio/associated_cancellation_slot.hpp>
|
||||||
#include <boost/asio/dispatch.hpp>
|
#include <boost/asio/dispatch.hpp>
|
||||||
#include <boost/asio/post.hpp>
|
#include <boost/asio/post.hpp>
|
||||||
#include <boost/asio/prepend.hpp>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -134,11 +133,11 @@ class basic_stream<Executor>::read_op : public detail::stream_read_op_base
|
|||||||
|
|
||||||
#if defined(BOOST_ASIO_NO_TS_EXECUTORS)
|
#if defined(BOOST_ASIO_NO_TS_EXECUTORS)
|
||||||
net::dispatch(wg2_,
|
net::dispatch(wg2_,
|
||||||
net::prepend(std::move(h_), ec, bytes_transferred));
|
net::append(std::move(h_), ec, bytes_transferred));
|
||||||
wg2_ = net::any_io_executor(); // probably unnecessary
|
wg2_ = net::any_io_executor(); // probably unnecessary
|
||||||
#else // defined(BOOST_ASIO_NO_TS_EXECUTORS)
|
#else // defined(BOOST_ASIO_NO_TS_EXECUTORS)
|
||||||
net::dispatch(wg2_.get_executor(),
|
net::dispatch(wg2_.get_executor(),
|
||||||
net::prepend(std::move(h_), ec, bytes_transferred));
|
net::append(std::move(h_), ec, bytes_transferred));
|
||||||
wg2_.reset();
|
wg2_.reset();
|
||||||
#endif // defined(BOOST_ASIO_NO_TS_EXECUTORS)
|
#endif // defined(BOOST_ASIO_NO_TS_EXECUTORS)
|
||||||
}
|
}
|
||||||
@ -171,10 +170,10 @@ public:
|
|||||||
operator()(error_code ec) override
|
operator()(error_code ec) override
|
||||||
{
|
{
|
||||||
#if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
|
#if defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
|
||||||
net::post(wg1_.get_executor(), net::prepend(std::move(fn_), ec));
|
net::post(wg1_.get_executor(), net::append(std::move(fn_), ec));
|
||||||
wg1_.reset();
|
wg1_.reset();
|
||||||
#else
|
#else
|
||||||
net::post(wg1_, net::prepend(std::move(fn_), ec));
|
net::post(wg1_, net::append(std::move(fn_), ec));
|
||||||
wg1_ = net::any_io_executor(); // probably unnecessary
|
wg1_ = net::any_io_executor(); // probably unnecessary
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -257,7 +256,7 @@ struct basic_stream<Executor>::run_write_op
|
|||||||
++in_->nwrite;
|
++in_->nwrite;
|
||||||
auto const upcall = [&](error_code ec, std::size_t n)
|
auto const upcall = [&](error_code ec, std::size_t n)
|
||||||
{
|
{
|
||||||
net::post(in_->exec, net::prepend(std::move(h), ec, n));
|
net::post(in_->exec, net::append(std::move(h), ec, n));
|
||||||
};
|
};
|
||||||
|
|
||||||
// test failure
|
// test failure
|
||||||
@ -477,7 +476,7 @@ async_teardown(
|
|||||||
s.in_->fc->fail(ec))
|
s.in_->fc->fail(ec))
|
||||||
return net::post(
|
return net::post(
|
||||||
s.get_executor(),
|
s.get_executor(),
|
||||||
net::prepend(std::move(handler), ec));
|
net::append(std::move(handler), ec));
|
||||||
s.close();
|
s.close();
|
||||||
if( s.in_->fc &&
|
if( s.in_->fc &&
|
||||||
s.in_->fc->fail(ec))
|
s.in_->fc->fail(ec))
|
||||||
@ -487,7 +486,7 @@ async_teardown(
|
|||||||
else
|
else
|
||||||
ec = {};
|
ec = {};
|
||||||
|
|
||||||
net::post(s.get_executor(), net::prepend(std::move(handler), ec));
|
net::post(s.get_executor(), net::append(std::move(handler), ec));
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
#include <boost/beast/core/detail/async_base.hpp>
|
#include <boost/beast/core/detail/async_base.hpp>
|
||||||
#include <boost/beast/core/detail/filtering_cancellation_slot.hpp>
|
#include <boost/beast/core/detail/filtering_cancellation_slot.hpp>
|
||||||
#include <boost/beast/core/detail/work_guard.hpp>
|
#include <boost/beast/core/detail/work_guard.hpp>
|
||||||
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/associated_allocator.hpp>
|
#include <boost/asio/associated_allocator.hpp>
|
||||||
#include <boost/asio/associated_cancellation_slot.hpp>
|
#include <boost/asio/associated_cancellation_slot.hpp>
|
||||||
#include <boost/asio/associated_executor.hpp>
|
#include <boost/asio/associated_executor.hpp>
|
||||||
#include <boost/asio/associated_immediate_executor.hpp>
|
#include <boost/asio/associated_immediate_executor.hpp>
|
||||||
#include <boost/asio/bind_executor.hpp>
|
#include <boost/asio/bind_executor.hpp>
|
||||||
#include <boost/asio/handler_continuation_hook.hpp>
|
|
||||||
#include <boost/asio/dispatch.hpp>
|
#include <boost/asio/dispatch.hpp>
|
||||||
|
#include <boost/asio/handler_continuation_hook.hpp>
|
||||||
#include <boost/asio/post.hpp>
|
#include <boost/asio/post.hpp>
|
||||||
#include <boost/asio/prepend.hpp>
|
|
||||||
#include <boost/core/exchange.hpp>
|
#include <boost/core/exchange.hpp>
|
||||||
#include <boost/core/empty_value.hpp>
|
#include <boost/core/empty_value.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -425,7 +425,7 @@ public:
|
|||||||
auto const ex = this->get_immediate_executor();
|
auto const ex = this->get_immediate_executor();
|
||||||
net::dispatch(
|
net::dispatch(
|
||||||
ex,
|
ex,
|
||||||
net::prepend(std::move(h_), std::forward<Args>(args)...));
|
net::append(std::move(h_), std::forward<Args>(args)...));
|
||||||
wg1_.reset();
|
wg1_.reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <boost/beast/core/buffer_traits.hpp>
|
#include <boost/beast/core/buffer_traits.hpp>
|
||||||
#include <boost/beast/core/buffers_prefix.hpp>
|
#include <boost/beast/core/buffers_prefix.hpp>
|
||||||
#include <boost/beast/websocket/teardown.hpp>
|
#include <boost/beast/websocket/teardown.hpp>
|
||||||
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/coroutine.hpp>
|
#include <boost/asio/coroutine.hpp>
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
@ -325,7 +326,7 @@ public:
|
|||||||
: "basic_stream::async_write_some")));
|
: "basic_stream::async_write_some")));
|
||||||
|
|
||||||
net::dispatch(this->get_immediate_executor(),
|
net::dispatch(this->get_immediate_executor(),
|
||||||
net::prepend(std::move(*this), ec, 0));
|
net::append(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_->close();
|
impl_->close();
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
#include <boost/beast/core/read_size.hpp>
|
#include <boost/beast/core/read_size.hpp>
|
||||||
#include <boost/beast/core/stream_traits.hpp>
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
#include <boost/beast/core/detail/is_invocable.hpp>
|
#include <boost/beast/core/detail/is_invocable.hpp>
|
||||||
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/dispatch.hpp>
|
#include <boost/asio/dispatch.hpp>
|
||||||
#include <boost/asio/prepend.hpp>
|
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
const auto ex = this->get_immediate_executor();
|
const auto ex = this->get_immediate_executor();
|
||||||
return net::dispatch(
|
return net::dispatch(
|
||||||
ex,
|
ex,
|
||||||
net::prepend(std::move(*this), ec, 0));
|
net::append(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
// upcall
|
// upcall
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
#include <boost/beast/core/stream_traits.hpp>
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
#include <boost/beast/core/detail/buffer.hpp>
|
#include <boost/beast/core/detail/buffer.hpp>
|
||||||
#include <boost/beast/core/detail/read.hpp>
|
#include <boost/beast/core/detail/read.hpp>
|
||||||
#include <boost/asio/error.hpp>
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/compose.hpp>
|
#include <boost/asio/compose.hpp>
|
||||||
#include <boost/asio/coroutine.hpp>
|
#include <boost/asio/coroutine.hpp>
|
||||||
#include <boost/asio/prepend.hpp>
|
#include <boost/asio/error.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace beast {
|
namespace beast {
|
||||||
@ -259,7 +259,7 @@ public:
|
|||||||
asio::get_associated_immediate_executor(
|
asio::get_associated_immediate_executor(
|
||||||
self, s_.get_executor());
|
self, s_.get_executor());
|
||||||
|
|
||||||
net::dispatch(ex, net::prepend(std::move(self), ec));
|
net::dispatch(ex, net::append(std::move(self), ec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.complete(ec, bytes_transferred_);
|
self.complete(ec, bytes_transferred_);
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
#include <boost/beast/core/make_printable.hpp>
|
#include <boost/beast/core/make_printable.hpp>
|
||||||
#include <boost/beast/core/stream_traits.hpp>
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
#include <boost/beast/core/detail/is_invocable.hpp>
|
#include <boost/beast/core/detail/is_invocable.hpp>
|
||||||
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/coroutine.hpp>
|
#include <boost/asio/coroutine.hpp>
|
||||||
#include <boost/asio/dispatch.hpp>
|
#include <boost/asio/dispatch.hpp>
|
||||||
#include <boost/asio/write.hpp>
|
#include <boost/asio/write.hpp>
|
||||||
#include <boost/asio/prepend.hpp>
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
"http::async_write_some"));
|
"http::async_write_some"));
|
||||||
|
|
||||||
const auto ex = asio::get_associated_immediate_executor(*this, s_.get_executor());
|
const auto ex = asio::get_associated_immediate_executor(*this, s_.get_executor());
|
||||||
return net::dispatch(ex, net::prepend(std::move(*this), ec, 0));
|
return net::dispatch(ex, net::append(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
if(f.invoked)
|
if(f.invoked)
|
||||||
{
|
{
|
||||||
@ -119,7 +119,7 @@ public:
|
|||||||
"http::async_write_some"));
|
"http::async_write_some"));
|
||||||
|
|
||||||
const auto ex = this->get_immediate_executor();
|
const auto ex = this->get_immediate_executor();
|
||||||
return net::dispatch(ex, net::prepend(std::move(*this), ec, 0));
|
return net::dispatch(ex, net::append(std::move(*this), ec, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#include <boost/beast/core/stream_traits.hpp>
|
#include <boost/beast/core/stream_traits.hpp>
|
||||||
#include <boost/beast/core/detail/bind_continuation.hpp>
|
#include <boost/beast/core/detail/bind_continuation.hpp>
|
||||||
#include <boost/beast/core/detail/is_invocable.hpp>
|
#include <boost/beast/core/detail/is_invocable.hpp>
|
||||||
|
#include <boost/asio/append.hpp>
|
||||||
#include <boost/asio/coroutine.hpp>
|
#include <boost/asio/coroutine.hpp>
|
||||||
#include <boost/asio/dispatch.hpp>
|
#include <boost/asio/dispatch.hpp>
|
||||||
#include <boost/asio/prepend.hpp>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
@ -129,7 +129,7 @@ public:
|
|||||||
));
|
));
|
||||||
|
|
||||||
const auto ex = this->get_immediate_executor();
|
const auto ex = this->get_immediate_executor();
|
||||||
net::dispatch(ex, net::prepend(std::move(*this), ec));
|
net::dispatch(ex, net::append(std::move(*this), ec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user