forked from boostorg/beast
net is a namespace alias for boost::asio:
The namespace alias beast::net replaces boost::asio in all code and documentation.
This commit is contained in:
@@ -32,11 +32,11 @@ public:
|
||||
coalesce(BufferSequence const& buffers, std::size_t limit)
|
||||
{
|
||||
std::pair<std::size_t, bool> result{0, false};
|
||||
auto first = boost::asio::buffer_sequence_begin(buffers);
|
||||
auto last = boost::asio::buffer_sequence_end(buffers);
|
||||
auto first = net::buffer_sequence_begin(buffers);
|
||||
auto last = net::buffer_sequence_end(buffers);
|
||||
if(first != last)
|
||||
{
|
||||
result.first = boost::asio::buffer_size(*first);
|
||||
result.first = net::buffer_size(*first);
|
||||
if(result.first < limit)
|
||||
{
|
||||
auto it = first;
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
while(++it != last)
|
||||
{
|
||||
auto const n =
|
||||
boost::asio::buffer_size(*it);
|
||||
net::buffer_size(*it);
|
||||
if(result.first + n > limit)
|
||||
break;
|
||||
result.first += n;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace beast {
|
||||
namespace detail {
|
||||
|
||||
timeout_service::
|
||||
timeout_service(boost::asio::io_context& ctx)
|
||||
timeout_service(net::io_context& ctx)
|
||||
: service_base(ctx)
|
||||
, thunks_(1) // element [0] reserved for "null"
|
||||
, timer_(ctx)
|
||||
@@ -272,7 +272,7 @@ void
|
||||
timeout_service::
|
||||
on_timer(error_code ec)
|
||||
{
|
||||
if(ec == boost::asio::error::operation_aborted)
|
||||
if(ec == net::error::operation_aborted)
|
||||
{
|
||||
BOOST_ASSERT(fresh_->empty());
|
||||
BOOST_ASSERT(stale_->empty());
|
||||
|
||||
@@ -17,23 +17,23 @@ namespace beast {
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
class service_id : public boost::asio::execution_context::id
|
||||
class service_id : public net::execution_context::id
|
||||
{
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class service_base
|
||||
: public boost::asio::execution_context::service
|
||||
: public net::execution_context::service
|
||||
{
|
||||
protected:
|
||||
boost::asio::execution_context& ctx_;
|
||||
net::execution_context& ctx_;
|
||||
|
||||
public:
|
||||
static service_id<T> id;
|
||||
|
||||
explicit
|
||||
service_base(boost::asio::execution_context& ctx)
|
||||
: boost::asio::execution_context::service(ctx)
|
||||
service_base(net::execution_context& ctx)
|
||||
: net::execution_context::service(ctx)
|
||||
, ctx_(ctx)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class timeout_service
|
||||
void
|
||||
operator()()
|
||||
{
|
||||
boost::asio::post(ex,
|
||||
net::post(ex,
|
||||
beast::bind_front_handler(
|
||||
std::move(*this), 0));
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
// VFALCO Should be execution_context
|
||||
BOOST_BEAST_DECL
|
||||
explicit
|
||||
timeout_service(boost::asio::io_context& ctx);
|
||||
timeout_service(net::io_context& ctx);
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
timeout_handle
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
thunk::list_type* stale_ = &list_[1];
|
||||
std::deque<thunk> thunks_;
|
||||
std::size_t free_thunk_ = 0;
|
||||
boost::asio::steady_timer timer_;
|
||||
net::steady_timer timer_;
|
||||
std::chrono::seconds interval_{30ul};
|
||||
long pending_ = 0;
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace beast {
|
||||
This wrapper flattens writes for buffer sequences having length
|
||||
greater than 1 and total size below a predefined amount, using
|
||||
a dynamic memory allocation. It is primarily designed to overcome
|
||||
a performance limitation of the current version of `boost::asio::ssl::stream`,
|
||||
a performance limitation of the current version of `net::ssl::stream`,
|
||||
which does not use OpenSSL's scatter/gather interface for its
|
||||
low-level read some and write some operations.
|
||||
|
||||
@@ -49,11 +49,11 @@ namespace beast {
|
||||
operate on synchronous or asynchronous read or write streams,
|
||||
examples include:
|
||||
|
||||
@li `boost::asio::read`, `boost::asio::async_read`
|
||||
@li `net::read`, `net::async_read`
|
||||
|
||||
@li `boost::asio::write`, `boost::asio::async_write`
|
||||
@li `net::write`, `net::async_write`
|
||||
|
||||
@li `boost::asio::read_until`, `boost::asio::async_read_until`
|
||||
@li `net::read_until`, `net::async_read_until`
|
||||
|
||||
The stream may also be used as a template parameter in other
|
||||
stream wrappers, such as for websocket:
|
||||
@@ -66,7 +66,7 @@ namespace beast {
|
||||
operations, the type must support the @b SyncStream concept. For
|
||||
asynchronous operations, the type must support the @b AsyncStream
|
||||
concept. This type will usually be some variation of
|
||||
`boost::asio::ssl::stream`.
|
||||
`net::ssl::stream`.
|
||||
|
||||
@par Concepts
|
||||
@b AsyncStream
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::read` if you need to ensure
|
||||
bytes. Consider using the function `net::read` if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
@returns The number of bytes read.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::read` if you need to ensure
|
||||
bytes. Consider using the function `net::read` if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::async_read` if you need
|
||||
bytes. Consider using the function `net::async_read` if you need
|
||||
to ensure that the requested amount of data is read before the asynchronous
|
||||
operation completes.
|
||||
*/
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the function `boost::asio::write` if you need to
|
||||
peer. Consider using the function `net::write` if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
@returns The number of bytes written.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the function `boost::asio::write` if you need to
|
||||
peer. Consider using the function `net::write` if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `async_write_some` operation may not transmit all of the data to
|
||||
the peer. Consider using the function `boost::asio::async_write` if you need
|
||||
the peer. Consider using the function `net::async_write` if you need
|
||||
to ensure that all data is written before the asynchronous operation completes.
|
||||
*/
|
||||
template<
|
||||
|
||||
@@ -25,14 +25,14 @@ namespace beast {
|
||||
template<class NextLayer>
|
||||
template<class ConstBufferSequence, class Handler>
|
||||
class flat_stream<NextLayer>::write_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
using alloc_type = typename
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
boost::asio::associated_allocator_t<Handler>::template
|
||||
net::associated_allocator_t<Handler>::template
|
||||
rebind<char>::other;
|
||||
#else
|
||||
std::allocator_traits<boost::asio::associated_allocator_t<Handler>>
|
||||
std::allocator_traits<net::associated_allocator_t<Handler>>
|
||||
::template rebind_alloc<char>;
|
||||
#endif
|
||||
|
||||
@@ -68,27 +68,27 @@ public:
|
||||
: s_(s)
|
||||
, b_(b)
|
||||
, p_(nullptr, deleter{
|
||||
(boost::asio::get_associated_allocator)(h)})
|
||||
(net::get_associated_allocator)(h)})
|
||||
, h_(std::forward<DeducedHandler>(h))
|
||||
{
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<NextLayer&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(write_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, write_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -133,12 +133,12 @@ operator()(
|
||||
p_.get_deleter().size = result.first;
|
||||
p_.reset(p_.get_deleter().alloc.allocate(
|
||||
p_.get_deleter().size));
|
||||
boost::asio::buffer_copy(
|
||||
boost::asio::buffer(
|
||||
net::buffer_copy(
|
||||
net::buffer(
|
||||
p_.get(), p_.get_deleter().size),
|
||||
b_, result.first);
|
||||
s_.stream_.async_write_some(
|
||||
boost::asio::buffer(
|
||||
net::buffer(
|
||||
p_.get(), p_.get_deleter().size),
|
||||
std::move(*this));
|
||||
}
|
||||
@@ -172,7 +172,7 @@ read_some(MutableBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_read_stream<next_layer_type>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -204,7 +204,7 @@ async_read_some(
|
||||
{
|
||||
static_assert(boost::beast::is_async_read_stream<next_layer_type>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence >::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
return stream_.async_read_some(
|
||||
@@ -219,15 +219,15 @@ write_some(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_write_stream<next_layer_type>::value,
|
||||
"SyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
auto const result = coalesce(buffers, coalesce_limit);
|
||||
if(result.second)
|
||||
{
|
||||
std::unique_ptr<char[]> p{new char[result.first]};
|
||||
auto const b = boost::asio::buffer(p.get(), result.first);
|
||||
boost::asio::buffer_copy(b, buffers);
|
||||
auto const b = net::buffer(p.get(), result.first);
|
||||
net::buffer_copy(b, buffers);
|
||||
return stream_.write_some(b);
|
||||
}
|
||||
return stream_.write_some(
|
||||
@@ -242,15 +242,15 @@ write_some(ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_write_stream<next_layer_type>::value,
|
||||
"SyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
auto const result = coalesce(buffers, coalesce_limit);
|
||||
if(result.second)
|
||||
{
|
||||
std::unique_ptr<char[]> p{new char[result.first]};
|
||||
auto const b = boost::asio::buffer(p.get(), result.first);
|
||||
boost::asio::buffer_copy(b, buffers);
|
||||
auto const b = net::buffer(p.get(), result.first);
|
||||
net::buffer_copy(b, buffers);
|
||||
return stream_.write_some(b, ec);
|
||||
}
|
||||
return stream_.write_some(
|
||||
@@ -270,7 +270,7 @@ async_write_some(
|
||||
{
|
||||
static_assert(boost::beast::is_async_write_stream<next_layer_type>::value,
|
||||
"AsyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace boost {
|
||||
namespace beast {
|
||||
|
||||
timeout_handle::
|
||||
timeout_handle(boost::asio::io_context& ioc)
|
||||
timeout_handle(net::io_context& ioc)
|
||||
: timeout_handle(
|
||||
boost::asio::use_service<
|
||||
net::use_service<
|
||||
detail::timeout_service>(
|
||||
ioc).make_handle())
|
||||
{
|
||||
@@ -50,10 +50,10 @@ set_callback(
|
||||
|
||||
void
|
||||
set_timeout_service_options(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
std::chrono::seconds interval)
|
||||
{
|
||||
boost::asio::use_service<
|
||||
net::use_service<
|
||||
detail::timeout_service>(
|
||||
ioc).set_option(interval);
|
||||
}
|
||||
|
||||
@@ -61,30 +61,30 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
using executor_type =
|
||||
boost::asio::associated_executor_t<Handler,
|
||||
net::associated_executor_t<Handler,
|
||||
decltype(std::declval<basic_timeout_socket<
|
||||
Protocol, Executor>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_executor(
|
||||
return net::get_associated_executor(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
friend
|
||||
bool asio_handler_is_continuation(async_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, async_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ private:
|
||||
Handler h_;
|
||||
basic_timeout_socket& s_;
|
||||
timeout_work_guard work_;
|
||||
boost::asio::executor_work_guard<Executor> wg0_;
|
||||
boost::asio::executor_work_guard<executor_type> wg1_;
|
||||
net::executor_work_guard<Executor> wg0_;
|
||||
net::executor_work_guard<executor_type> wg1_;
|
||||
detail::saved_handler& saved_;
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ async_read_some(
|
||||
MutableBufferSequence const& buffers,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -198,7 +198,7 @@ async_write_some(
|
||||
ConstBufferSequence const& buffers,
|
||||
WriteHandler&& handler)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -235,36 +235,36 @@ public:
|
||||
, wg0_(s_.get_executor())
|
||||
, wg1_(get_executor())
|
||||
{
|
||||
boost::asio::async_connect(
|
||||
net::async_connect(
|
||||
s_.next_layer(), eps, cond,
|
||||
std::move(*this));
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
using executor_type =
|
||||
boost::asio::associated_executor_t<Handler,
|
||||
net::associated_executor_t<Handler,
|
||||
decltype(std::declval<basic_timeout_socket<
|
||||
Protocol, Executor>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_executor(
|
||||
return net::get_associated_executor(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
friend
|
||||
bool asio_handler_is_continuation(connect_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -273,7 +273,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, connect_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
|
||||
@@ -296,8 +296,8 @@ private:
|
||||
Handler h_;
|
||||
timeout_work_guard work_;
|
||||
basic_timeout_socket<Protocol, Executor>& s_;
|
||||
boost::asio::executor_work_guard<Executor> wg0_;
|
||||
boost::asio::executor_work_guard<executor_type> wg1_;
|
||||
net::executor_work_guard<Executor> wg0_;
|
||||
net::executor_work_guard<executor_type> wg1_;
|
||||
};
|
||||
|
||||
struct any_endpoint
|
||||
|
||||
@@ -37,14 +37,14 @@ namespace beast {
|
||||
strand.
|
||||
|
||||
@par Example
|
||||
To use this template with a `boost::asio::ip::tcp::socket`, you would write:
|
||||
To use this template with a `net::ip::tcp::socket`, you would write:
|
||||
@code
|
||||
boost::asio::io_context ioc;
|
||||
boost::asio::ssl::context ctx{boost::asio::ssl::context::sslv23};
|
||||
boost::beast::ssl_stream<boost::asio:ip::tcp::socket> sock{ioc, ctx};
|
||||
net::io_context ioc;
|
||||
net::ssl::context ctx{net::ssl::context::sslv23};
|
||||
boost::beast::ssl_stream<net:ip::tcp::socket> sock{ioc, ctx};
|
||||
@endcode
|
||||
|
||||
In addition to providing an interface identical to `boost::asio::ssl::stream`,
|
||||
In addition to providing an interface identical to `net::ssl::stream`,
|
||||
the wrapper has the following additional properties:
|
||||
|
||||
@li Satisfies @b MoveConstructible
|
||||
@@ -54,7 +54,7 @@ namespace beast {
|
||||
@li Constructible from a moved socket.
|
||||
|
||||
@li Uses @ref flat_stream internally, as a performance work-around for a
|
||||
limitation of `boost::asio::ssl::stream` when writing buffer sequences
|
||||
limitation of `net::ssl::stream` when writing buffer sequences
|
||||
having length greater than one.
|
||||
|
||||
@par Concepts:
|
||||
@@ -66,9 +66,9 @@ namespace beast {
|
||||
*/
|
||||
template<class NextLayer>
|
||||
class ssl_stream
|
||||
: public boost::asio::ssl::stream_base
|
||||
: public net::ssl::stream_base
|
||||
{
|
||||
using ssl_stream_type = boost::asio::ssl::stream<NextLayer>;
|
||||
using ssl_stream_type = net::ssl::stream<NextLayer>;
|
||||
using stream_type = boost::beast::flat_stream<ssl_stream_type>;
|
||||
|
||||
std::unique_ptr<stream_type> p_;
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
template<class Arg>
|
||||
ssl_stream(
|
||||
Arg&& arg,
|
||||
boost::asio::ssl::context& ctx)
|
||||
net::ssl::context& ctx)
|
||||
: p_(new stream_type{
|
||||
std::forward<Arg>(arg), ctx})
|
||||
{
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
suitable for passing to functions such as @c SSL_get_verify_result and
|
||||
@c SSL_get_peer_certificate:
|
||||
@code
|
||||
boost::beast::ssl_stream<boost::asio:ip::tcp::socket> ss{ioc, ctx};
|
||||
boost::beast::ssl_stream<net::ip::tcp::socket> ss{ioc, ctx};
|
||||
|
||||
// ... establish connection and perform handshake ...
|
||||
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
@note Calls @c SSL_set_verify.
|
||||
*/
|
||||
void
|
||||
set_verify_mode(boost::asio::ssl::verify_mode v)
|
||||
set_verify_mode(net::ssl::verify_mode v)
|
||||
{
|
||||
p_->next_layer().set_verify_mode(v);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
@note Calls @c SSL_set_verify.
|
||||
*/
|
||||
void
|
||||
set_verify_mode(boost::asio::ssl::verify_mode v,
|
||||
set_verify_mode(net::ssl::verify_mode v,
|
||||
boost::system::error_code& ec)
|
||||
{
|
||||
p_->next_layer().set_verify_mode(v, ec);
|
||||
@@ -320,7 +320,7 @@ public:
|
||||
The function signature of the handler must be:
|
||||
@code bool verify_callback(
|
||||
bool preverified, // True if the certificate passed pre-verification.
|
||||
boost::asio::verify_context& ctx // The peer certificate and other context.
|
||||
net::verify_context& ctx // The peer certificate and other context.
|
||||
); @endcode
|
||||
The return value of the callback is true if the certificate has passed
|
||||
verification, false otherwise.
|
||||
@@ -527,7 +527,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the `boost::asio::write` function if you need to
|
||||
peer. Consider using the `net::write` function if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -550,7 +550,7 @@ public:
|
||||
@returns The number of bytes written. Returns 0 if an error occurred.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the `boost::asio::write` function if you need to
|
||||
peer. Consider using the `net::write` function if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `async_write_some` operation may not transmit all of the data to
|
||||
the peer. Consider using the `boost::asio::async_write` function if you
|
||||
the peer. Consider using the `net::async_write` function if you
|
||||
need to ensure that all data is written before the asynchronous operation
|
||||
completes.
|
||||
*/
|
||||
@@ -607,7 +607,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the `boost::asio::read` function if you need to ensure
|
||||
bytes. Consider using the `net::read` function if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -631,7 +631,7 @@ public:
|
||||
@returns The number of bytes read. Returns 0 if an error occurred.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the `boost::asio::read` function if you need to ensure
|
||||
bytes. Consider using the `net::read` function if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -662,7 +662,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `async_read_some` operation may not read all of the requested
|
||||
number of bytes. Consider using the `boost::asio::async_read` function
|
||||
number of bytes. Consider using the `net::async_read` function
|
||||
if you need to ensure that the requested amount of data is read before
|
||||
the asynchronous operation completes.
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
// VFALCO should be execution_context
|
||||
BOOST_BEAST_DECL
|
||||
explicit
|
||||
timeout_handle(boost::asio::io_context& ioc);
|
||||
timeout_handle(net::io_context& ioc);
|
||||
|
||||
BOOST_BEAST_DECL
|
||||
void
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
BOOST_BEAST_DECL
|
||||
void
|
||||
set_timeout_service_options(
|
||||
boost::asio::io_context& ctx, // VFALCO should be execution_context
|
||||
net::io_context& ctx, // VFALCO should be execution_context
|
||||
std::chrono::seconds interval);
|
||||
|
||||
} // beast
|
||||
|
||||
@@ -46,7 +46,7 @@ class connect_op;
|
||||
*/
|
||||
template<
|
||||
class Protocol,
|
||||
class Executor = boost::asio::executor
|
||||
class Executor = net::executor
|
||||
>
|
||||
class basic_timeout_socket
|
||||
{
|
||||
@@ -57,14 +57,14 @@ class basic_timeout_socket
|
||||
timeout_handle rd_timer_;
|
||||
timeout_handle wr_timer_;
|
||||
timeout_handle cn_timer_;
|
||||
boost::asio::basic_stream_socket<Protocol> sock_;
|
||||
net::basic_stream_socket<Protocol> sock_;
|
||||
detail::saved_handler rd_op_;
|
||||
detail::saved_handler wr_op_;
|
||||
detail::saved_handler cn_op_;
|
||||
|
||||
public:
|
||||
/// The type of the next layer.
|
||||
using next_layer_type = boost::asio::basic_stream_socket<Protocol>;
|
||||
using next_layer_type = net::basic_stream_socket<Protocol>;
|
||||
|
||||
/// The type of the lowest layer.
|
||||
using lowest_layer_type = get_lowest_layer<next_layer_type>;
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
, class = typename std::enable_if<
|
||||
std::is_convertible<
|
||||
ExecutionContext&,
|
||||
boost::asio::execution_context&>::value &&
|
||||
net::execution_context&>::value &&
|
||||
std::is_constructible<
|
||||
executor_type,
|
||||
typename ExecutionContext::executor_type>::value
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
boost::asio::io_context::post().
|
||||
net::io_context::post().
|
||||
*/
|
||||
template<class MutableBufferSequence, class ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
boost::asio::io_context::post().
|
||||
net::io_context::post().
|
||||
*/
|
||||
template<class ConstBufferSequence, class WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
@@ -239,8 +239,8 @@ public:
|
||||
|
||||
/// A TCP/IP socket wrapper which has a built-in asynchronous timeout
|
||||
using timeout_socket = basic_timeout_socket<
|
||||
boost::asio::ip::tcp,
|
||||
boost::asio::io_context::executor_type>;
|
||||
net::ip::tcp,
|
||||
net::io_context::executor_type>;
|
||||
|
||||
/**
|
||||
@defgroup async_connect boost::beast::async_connect
|
||||
@@ -267,7 +267,7 @@ using timeout_socket = basic_timeout_socket<
|
||||
@code
|
||||
void handler(
|
||||
// Result of operation. if the sequence is empty, set to
|
||||
// boost::asio::error::not_found. Otherwise, contains the
|
||||
// net::error::not_found. Otherwise, contains the
|
||||
// error from the last connection attempt.
|
||||
error_code const& error,
|
||||
|
||||
@@ -280,13 +280,13 @@ using timeout_socket = basic_timeout_socket<
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
`boost::asio::io_context::post()`.
|
||||
`net::io_context::post()`.
|
||||
|
||||
@par Example
|
||||
|
||||
@code
|
||||
boost::asio::tcp::resolver r(ioc);
|
||||
boost::asio::tcp::resolver::query q("host", "service");
|
||||
net::tcp::resolver r(ioc);
|
||||
net::tcp::resolver::query q("host", "service");
|
||||
timeout_socket s(ioc.get_executor());
|
||||
|
||||
// ...
|
||||
@@ -321,7 +321,7 @@ template<
|
||||
class RangeConnectHandler
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
,class = typename std::enable_if<
|
||||
boost::asio::is_endpoint_sequence<
|
||||
net::is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type
|
||||
#endif
|
||||
>
|
||||
@@ -365,7 +365,7 @@ async_connect(
|
||||
@code
|
||||
void handler(
|
||||
// Result of operation. if the sequence is empty, set to
|
||||
// boost::asio::error::not_found. Otherwise, contains the
|
||||
// net::error::not_found. Otherwise, contains the
|
||||
// error from the last connection attempt.
|
||||
error_code const& error,
|
||||
|
||||
@@ -378,7 +378,7 @@ async_connect(
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
`boost::asio::io_context::post()`.
|
||||
`net::io_context::post()`.
|
||||
|
||||
@par Example
|
||||
|
||||
@@ -390,7 +390,7 @@ async_connect(
|
||||
{
|
||||
bool operator()(
|
||||
boost::system::error_code const& ec,
|
||||
boost::asio::ip::tcp::endpoint const& next)
|
||||
net::ip::tcp::endpoint const& next)
|
||||
{
|
||||
if (ec) std::cout << "Error: " << ec.message() << std::endl;
|
||||
std::cout << "Trying: " << next << std::endl;
|
||||
@@ -403,8 +403,8 @@ async_connect(
|
||||
function as follows:
|
||||
|
||||
@code
|
||||
boost::asio::tcp::resolver r(ioc);
|
||||
boost::asio::tcp::resolver::query q("host", "service");
|
||||
net::tcp::resolver r(ioc);
|
||||
net::tcp::resolver::query q("host", "service");
|
||||
timeout_socket s(ioc.get_executor());
|
||||
|
||||
// ...
|
||||
@@ -440,7 +440,7 @@ template<
|
||||
class RangeConnectHandler
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
,class = typename std::enable_if<
|
||||
boost::asio::is_endpoint_sequence<
|
||||
net::is_endpoint_sequence<
|
||||
EndpointSequence>::value>::type
|
||||
#endif
|
||||
>
|
||||
@@ -472,7 +472,7 @@ async_connect(
|
||||
@code
|
||||
void handler(
|
||||
// Result of operation. if the sequence is empty, set to
|
||||
// boost::asio::error::not_found. Otherwise, contains the
|
||||
// net::error::not_found. Otherwise, contains the
|
||||
// error from the last connection attempt.
|
||||
error_code const& error,
|
||||
|
||||
@@ -485,7 +485,7 @@ async_connect(
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
`boost::asio::io_context::post()`.
|
||||
`net::io_context::post()`.
|
||||
|
||||
@par Example
|
||||
|
||||
@@ -511,7 +511,7 @@ template<
|
||||
class IteratorConnectHandler
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
,class = typename std::enable_if<
|
||||
! boost::asio::is_endpoint_sequence<
|
||||
! net::is_endpoint_sequence<
|
||||
Iterator>::value>::type
|
||||
#endif
|
||||
>
|
||||
@@ -551,7 +551,7 @@ async_connect(
|
||||
@code
|
||||
void handler(
|
||||
// Result of operation. if the sequence is empty, set to
|
||||
// boost::asio::error::not_found. Otherwise, contains the
|
||||
// net::error::not_found. Otherwise, contains the
|
||||
// error from the last connection attempt.
|
||||
error_code const& error,
|
||||
|
||||
@@ -564,7 +564,7 @@ async_connect(
|
||||
Regardless of whether the asynchronous operation completes immediately or
|
||||
not, the handler will not be invoked from within this function. Invocation
|
||||
of the handler will be performed in a manner equivalent to using
|
||||
`boost::asio::io_context::post()`.
|
||||
`net::io_context::post()`.
|
||||
|
||||
@par Example
|
||||
|
||||
@@ -576,7 +576,7 @@ async_connect(
|
||||
{
|
||||
bool operator()(
|
||||
boost::system::error_code const& ec,
|
||||
boost::asio::ip::tcp::endpoint const& next)
|
||||
net::ip::tcp::endpoint const& next)
|
||||
{
|
||||
if (ec) std::cout << "Error: " << ec.message() << std::endl;
|
||||
std::cout << "Trying: " << next << std::endl;
|
||||
@@ -610,7 +610,7 @@ template<
|
||||
class IteratorConnectHandler
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
,class = typename std::enable_if<
|
||||
! boost::asio::is_endpoint_sequence<
|
||||
! net::is_endpoint_sequence<
|
||||
Iterator>::value>::type
|
||||
#endif
|
||||
>
|
||||
|
||||
@@ -76,7 +76,7 @@ class icy_stream
|
||||
char buf_[8];
|
||||
|
||||
static
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
version()
|
||||
{
|
||||
return {"HTTP/1.1", 8};
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::read` if you need to ensure
|
||||
bytes. Consider using the function `net::read` if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
@returns The number of bytes read.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::read` if you need to ensure
|
||||
bytes. Consider using the function `net::read` if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::async_read` if you need
|
||||
bytes. Consider using the function `net::async_read` if you need
|
||||
to ensure that the requested amount of data is read before the asynchronous
|
||||
operation completes.
|
||||
*/
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the function `boost::asio::write` if you need to
|
||||
peer. Consider using the function `net::write` if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -295,7 +295,7 @@ public:
|
||||
@returns The number of bytes written.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the function `boost::asio::write` if you need to
|
||||
peer. Consider using the function `net::write` if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `async_write_some` operation may not transmit all of the data to
|
||||
the peer. Consider using the function `boost::asio::async_write` if you need
|
||||
the peer. Consider using the function `net::async_write` if you need
|
||||
to ensure that all data is written before the asynchronous operation completes.
|
||||
*/
|
||||
template<
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
|
||||
template<class DynamicBuffer>
|
||||
typename std::enable_if<
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
dynamic_buffer_ref<DynamicBuffer>>::type
|
||||
ref(DynamicBuffer& b)
|
||||
{
|
||||
@@ -114,16 +114,16 @@ template<class MutableBuffers, class ConstBuffers>
|
||||
void
|
||||
buffer_shift(MutableBuffers const& out, ConstBuffers const& in)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
auto in_pos = boost::asio::buffer_sequence_end(in);
|
||||
auto out_pos = boost::asio::buffer_sequence_end(out);
|
||||
auto const in_begin = boost::asio::buffer_sequence_begin(in);
|
||||
auto const out_begin = boost::asio::buffer_sequence_begin(out);
|
||||
using net::buffer_size;
|
||||
auto in_pos = net::buffer_sequence_end(in);
|
||||
auto out_pos = net::buffer_sequence_end(out);
|
||||
auto const in_begin = net::buffer_sequence_begin(in);
|
||||
auto const out_begin = net::buffer_sequence_begin(out);
|
||||
BOOST_ASSERT(buffer_size(in) == buffer_size(out));
|
||||
if(in_pos == in_begin || out_pos == out_begin)
|
||||
return;
|
||||
boost::asio::const_buffer cb{*--in_pos};
|
||||
boost::asio::mutable_buffer mb{*--out_pos};
|
||||
net::const_buffer cb{*--in_pos};
|
||||
net::mutable_buffer mb{*--out_pos};
|
||||
for(;;)
|
||||
{
|
||||
if(mb.size() >= cb.size())
|
||||
@@ -133,7 +133,7 @@ buffer_shift(MutableBuffers const& out, ConstBuffers const& in)
|
||||
mb.data()) + mb.size() - cb.size(),
|
||||
cb.data(),
|
||||
cb.size());
|
||||
mb = boost::asio::mutable_buffer{
|
||||
mb = net::mutable_buffer{
|
||||
mb.data(), mb.size() - cb.size()};
|
||||
if(in_pos == in_begin)
|
||||
break;
|
||||
@@ -146,7 +146,7 @@ buffer_shift(MutableBuffers const& out, ConstBuffers const& in)
|
||||
static_cast<char const*>(
|
||||
cb.data()) + cb.size() - mb.size(),
|
||||
mb.size());
|
||||
cb = boost::asio::const_buffer{
|
||||
cb = net::const_buffer{
|
||||
cb.data(), cb.size() - mb.size()};
|
||||
if(out_pos == out_begin)
|
||||
break;
|
||||
@@ -194,14 +194,14 @@ public:
|
||||
template<class NextLayer>
|
||||
template<class MutableBufferSequence, class Handler>
|
||||
class icy_stream<NextLayer>::read_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
using alloc_type = typename
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
boost::asio::associated_allocator_t<Handler>::template
|
||||
net::associated_allocator_t<Handler>::template
|
||||
rebind<char>::other;
|
||||
#else
|
||||
std::allocator_traits<boost::asio::associated_allocator_t<Handler>>
|
||||
std::allocator_traits<net::associated_allocator_t<Handler>>
|
||||
::template rebind_alloc<char>;
|
||||
#endif
|
||||
|
||||
@@ -237,21 +237,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<NextLayer&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->s.get_executor());
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->d_.handler()));
|
||||
}
|
||||
};
|
||||
@@ -278,9 +278,9 @@ operator()(
|
||||
error_code ec,
|
||||
std::size_t bytes_transferred)
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using iterator = boost::asio::buffers_iterator<
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using iterator = net::buffers_iterator<
|
||||
typename detail::dynamic_buffer_ref<
|
||||
buffers_adapter<MutableBufferSequence>>::const_buffers_type>;
|
||||
auto& d = *d_;
|
||||
@@ -289,7 +289,7 @@ operator()(
|
||||
if(d.b.max_size() == 0)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(d.s.get_executor(),
|
||||
net::post(d.s.get_executor(),
|
||||
beast::bind_handler(std::move(*this), ec, 0));
|
||||
goto upcall;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ operator()(
|
||||
auto const n = buffer_copy(
|
||||
d.b.prepare(std::min<std::size_t>(
|
||||
d.s.copy_, d.b.max_size())),
|
||||
boost::asio::buffer(d.s.buf_));
|
||||
net::buffer(d.s.buf_));
|
||||
d.b.commit(n);
|
||||
d.s.copy_ = static_cast<unsigned char>(
|
||||
d.s.copy_ - n);
|
||||
@@ -326,9 +326,9 @@ operator()(
|
||||
if(d.b.max_size() < 8)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_read(
|
||||
net::async_read(
|
||||
d.s.next_layer(),
|
||||
boost::asio::buffer(d.s.buf_, 3),
|
||||
net::buffer(d.s.buf_, 3),
|
||||
std::move(*this));
|
||||
if(ec)
|
||||
goto upcall;
|
||||
@@ -341,7 +341,7 @@ operator()(
|
||||
{
|
||||
buffer_copy(
|
||||
d.b.value(),
|
||||
boost::asio::buffer(d.s.buf_, n));
|
||||
net::buffer(d.s.buf_, n));
|
||||
if(d.b.max_size() < 3)
|
||||
{
|
||||
d.s.copy_ = static_cast<unsigned char>(
|
||||
@@ -358,7 +358,7 @@ operator()(
|
||||
}
|
||||
d.s.copy_ = static_cast<unsigned char>(
|
||||
buffer_copy(
|
||||
boost::asio::buffer(d.s.buf_),
|
||||
net::buffer(d.s.buf_),
|
||||
icy_stream::version() + d.b.max_size()));
|
||||
bytes_transferred = buffer_copy(
|
||||
d.b.value(),
|
||||
@@ -367,7 +367,7 @@ operator()(
|
||||
}
|
||||
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_read_until(
|
||||
net::async_read_until(
|
||||
d.s.next_layer(),
|
||||
detail::ref(d.b),
|
||||
detail::match_icy<iterator>(d.match),
|
||||
@@ -384,8 +384,8 @@ operator()(
|
||||
d.s.copy_ = static_cast<unsigned char>(
|
||||
n + 5 - d.b.max_size());
|
||||
std::copy(
|
||||
boost::asio::buffers_begin(d.b.value()) + n - d.s.copy_,
|
||||
boost::asio::buffers_begin(d.b.value()) + n,
|
||||
net::buffers_begin(d.b.value()) + n - d.s.copy_,
|
||||
net::buffers_begin(d.b.value()) + n,
|
||||
d.s.buf_);
|
||||
n = d.b.max_size() - 5;
|
||||
}
|
||||
@@ -425,7 +425,7 @@ read_some(MutableBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_read_stream<next_layer_type>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -443,12 +443,12 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_read_stream<next_layer_type>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using iterator = boost::asio::buffers_iterator<
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using iterator = net::buffers_iterator<
|
||||
typename detail::dynamic_buffer_ref<
|
||||
buffers_adapter<MutableBufferSequence>>::const_buffers_type>;
|
||||
buffers_adapter<MutableBufferSequence> b(buffers);
|
||||
@@ -464,7 +464,7 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
auto const n = buffer_copy(
|
||||
b.prepare(std::min<std::size_t>(
|
||||
copy_, b.max_size())),
|
||||
boost::asio::buffer(buf_));
|
||||
net::buffer(buf_));
|
||||
b.commit(n);
|
||||
copy_ = static_cast<unsigned char>(
|
||||
copy_ - n);
|
||||
@@ -483,9 +483,9 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
detect_ = false;
|
||||
if(b.max_size() < 8)
|
||||
{
|
||||
auto n = boost::asio::read(
|
||||
auto n = net::read(
|
||||
stream_,
|
||||
boost::asio::buffer(buf_, 3),
|
||||
net::buffer(buf_, 3),
|
||||
ec);
|
||||
if(ec)
|
||||
return 0;
|
||||
@@ -497,7 +497,7 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
buffer_copy(
|
||||
buffers,
|
||||
boost::asio::buffer(buf_, n));
|
||||
net::buffer(buf_, n));
|
||||
if(b.max_size() < 3)
|
||||
{
|
||||
copy_ = static_cast<unsigned char>(
|
||||
@@ -512,7 +512,7 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
}
|
||||
copy_ = static_cast<unsigned char>(
|
||||
buffer_copy(
|
||||
boost::asio::buffer(buf_),
|
||||
net::buffer(buf_),
|
||||
version() + b.max_size()));
|
||||
return buffer_copy(
|
||||
buffers,
|
||||
@@ -520,7 +520,7 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
}
|
||||
|
||||
bool match = false;
|
||||
auto n = boost::asio::read_until(
|
||||
auto n = net::read_until(
|
||||
stream_,
|
||||
detail::ref(b),
|
||||
detail::match_icy<iterator>(match),
|
||||
@@ -535,8 +535,8 @@ read_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
copy_ = static_cast<unsigned char>(
|
||||
n + 5 - b.max_size());
|
||||
std::copy(
|
||||
boost::asio::buffers_begin(buffers) + n - copy_,
|
||||
boost::asio::buffers_begin(buffers) + n,
|
||||
net::buffers_begin(buffers) + n - copy_,
|
||||
net::buffers_begin(buffers) + n,
|
||||
buf_);
|
||||
n = b.max_size() - 5;
|
||||
}
|
||||
@@ -565,7 +565,7 @@ async_read_some(
|
||||
{
|
||||
static_assert(boost::beast::is_async_read_stream<next_layer_type>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence >::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -587,7 +587,7 @@ write_some(MutableBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_write_stream<next_layer_type>::value,
|
||||
"SyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
return stream_.write_some(buffers);
|
||||
@@ -601,7 +601,7 @@ write_some(MutableBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(boost::beast::is_sync_write_stream<next_layer_type>::value,
|
||||
"SyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
return stream_.write_some(buffers, ec);
|
||||
@@ -620,7 +620,7 @@ async_write_some(
|
||||
{
|
||||
static_assert(boost::beast::is_async_write_stream<next_layer_type>::value,
|
||||
"AsyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
return stream_.async_write_some(buffers, std::forward<WriteHandler>(handler));
|
||||
|
||||
@@ -62,7 +62,7 @@ operator=(stream&& other)
|
||||
|
||||
inline
|
||||
stream::
|
||||
stream(boost::asio::io_context& ioc)
|
||||
stream(net::io_context& ioc)
|
||||
: in_(std::make_shared<state>(ioc, nullptr))
|
||||
{
|
||||
}
|
||||
@@ -70,7 +70,7 @@ stream(boost::asio::io_context& ioc)
|
||||
inline
|
||||
stream::
|
||||
stream(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
fail_count& fc)
|
||||
: in_(std::make_shared<state>(ioc, &fc))
|
||||
{
|
||||
@@ -79,12 +79,12 @@ stream(
|
||||
inline
|
||||
stream::
|
||||
stream(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
string_view s)
|
||||
: in_(std::make_shared<state>(ioc, nullptr))
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
in_->b.commit(buffer_copy(
|
||||
in_->b.prepare(s.size()),
|
||||
buffer(s.data(), s.size())));
|
||||
@@ -93,13 +93,13 @@ stream(
|
||||
inline
|
||||
stream::
|
||||
stream(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
fail_count& fc,
|
||||
string_view s)
|
||||
: in_(std::make_shared<state>(ioc, &fc))
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
in_->b.commit(buffer_copy(
|
||||
in_->b.prepare(s.size()),
|
||||
buffer(s.data(), s.size())));
|
||||
@@ -121,7 +121,7 @@ stream::
|
||||
str() const
|
||||
{
|
||||
auto const bs = in_->b.data();
|
||||
if(boost::asio::buffer_size(bs) == 0)
|
||||
if(net::buffer_size(bs) == 0)
|
||||
return {};
|
||||
auto const b = buffers_front(bs);
|
||||
return {static_cast<char const*>(b.data()), b.size()};
|
||||
@@ -132,8 +132,8 @@ void
|
||||
stream::
|
||||
append(string_view s)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
std::lock_guard<std::mutex> lock{in_->m};
|
||||
in_->b.commit(buffer_copy(
|
||||
in_->b.prepare(s.size()),
|
||||
@@ -184,7 +184,7 @@ std::size_t
|
||||
stream::
|
||||
read_some(MutableBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -200,11 +200,11 @@ stream::
|
||||
read_some(MutableBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
if(in_->fc && in_->fc->fail(ec))
|
||||
return 0;
|
||||
if(buffer_size(buffers) == 0)
|
||||
@@ -234,9 +234,9 @@ read_some(MutableBufferSequence const& buffers,
|
||||
BOOST_ASSERT(in_->code != status::ok);
|
||||
bytes_transferred = 0;
|
||||
if(in_->code == status::eof)
|
||||
ec = boost::asio::error::eof;
|
||||
ec = net::error::eof;
|
||||
else if(in_->code == status::reset)
|
||||
ec = boost::asio::error::connection_reset;
|
||||
ec = net::error::connection_reset;
|
||||
}
|
||||
++in_->nread;
|
||||
return bytes_transferred;
|
||||
@@ -250,18 +250,18 @@ async_read_some(
|
||||
MutableBufferSequence const& buffers,
|
||||
ReadHandler&& handler)
|
||||
{
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
ReadHandler, void(error_code, std::size_t));
|
||||
|
||||
error_code ec;
|
||||
if(in_->fc && in_->fc->fail(ec))
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
in_->ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
@@ -280,7 +280,7 @@ async_read_some(
|
||||
in_->b.consume(bytes_transferred);
|
||||
lock.unlock();
|
||||
++in_->nread;
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
in_->ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
@@ -292,10 +292,10 @@ async_read_some(
|
||||
lock.unlock();
|
||||
++in_->nread;
|
||||
if(in_->code == status::eof)
|
||||
ec = boost::asio::error::eof;
|
||||
ec = net::error::eof;
|
||||
else if(in_->code == status::reset)
|
||||
ec = boost::asio::error::connection_reset;
|
||||
boost::asio::post(
|
||||
ec = net::error::connection_reset;
|
||||
net::post(
|
||||
in_->ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
@@ -318,7 +318,7 @@ std::size_t
|
||||
stream::
|
||||
write_some(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -335,15 +335,15 @@ stream::
|
||||
write_some(
|
||||
ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
auto out = out_.lock();
|
||||
if(! out)
|
||||
{
|
||||
ec = boost::asio::error::connection_reset;
|
||||
ec = net::error::connection_reset;
|
||||
return 0;
|
||||
}
|
||||
BOOST_ASSERT(out->code == status::ok);
|
||||
@@ -369,21 +369,21 @@ stream::
|
||||
async_write_some(ConstBufferSequence const& buffers,
|
||||
WriteHandler&& handler)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
WriteHandler, void(error_code, std::size_t));
|
||||
auto out = out_.lock();
|
||||
if(! out)
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
in_->ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
boost::asio::error::connection_reset,
|
||||
net::error::connection_reset,
|
||||
0));
|
||||
}
|
||||
else
|
||||
@@ -392,7 +392,7 @@ async_write_some(ConstBufferSequence const& buffers,
|
||||
error_code ec;
|
||||
if(in_->fc && in_->fc->fail(ec))
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
in_->ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
@@ -410,7 +410,7 @@ async_write_some(ConstBufferSequence const& buffers,
|
||||
out->on_write();
|
||||
lock.unlock();
|
||||
++in_->nwrite;
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
in_->ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(init.completion_handler),
|
||||
@@ -437,7 +437,7 @@ boost::system::error_code& ec)
|
||||
|
||||
if( s.in_->fc &&
|
||||
s.in_->fc->fail(ec))
|
||||
ec = boost::asio::error::eof;
|
||||
ec = net::error::eof;
|
||||
else
|
||||
ec.assign(0, ec.category());
|
||||
}
|
||||
@@ -453,17 +453,17 @@ TeardownHandler&& handler)
|
||||
error_code ec;
|
||||
if( s.in_->fc &&
|
||||
s.in_->fc->fail(ec))
|
||||
return boost::asio::post(
|
||||
return net::post(
|
||||
s.get_executor(),
|
||||
beast::bind_front_handler(std::move(handler), ec));
|
||||
s.close();
|
||||
if( s.in_->fc &&
|
||||
s.in_->fc->fail(ec))
|
||||
ec = boost::asio::error::eof;
|
||||
ec = net::error::eof;
|
||||
else
|
||||
ec.assign(0, ec.category());
|
||||
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
s.get_executor(),
|
||||
beast::bind_front_handler(std::move(handler), ec));
|
||||
}
|
||||
@@ -478,8 +478,8 @@ class stream::read_op : public stream::read_op_base
|
||||
state& s_;
|
||||
Buffers b_;
|
||||
Handler h_;
|
||||
boost::asio::executor_work_guard<
|
||||
boost::asio::io_context::executor_type> work_;
|
||||
net::executor_work_guard<
|
||||
net::io_context::executor_type> work_;
|
||||
|
||||
public:
|
||||
lambda(lambda&&) = default;
|
||||
@@ -497,7 +497,7 @@ class stream::read_op : public stream::read_op_base
|
||||
void
|
||||
post()
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
s_.ioc.get_executor(),
|
||||
std::move(*this));
|
||||
work_.reset();
|
||||
@@ -506,8 +506,8 @@ class stream::read_op : public stream::read_op_base
|
||||
void
|
||||
operator()()
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
std::unique_lock<std::mutex> lock{s_.m};
|
||||
BOOST_ASSERT(! s_.op);
|
||||
if(s_.b.size() > 0)
|
||||
@@ -519,7 +519,7 @@ class stream::read_op : public stream::read_op_base
|
||||
Handler h{std::move(h_)};
|
||||
lock.unlock();
|
||||
++s.nread;
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
s.ioc.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(h),
|
||||
@@ -535,10 +535,10 @@ class stream::read_op : public stream::read_op_base
|
||||
++s.nread;
|
||||
error_code ec;
|
||||
if(s.code == status::eof)
|
||||
ec = boost::asio::error::eof;
|
||||
ec = net::error::eof;
|
||||
else if(s.code == status::reset)
|
||||
ec = boost::asio::error::connection_reset;
|
||||
boost::asio::post(
|
||||
ec = net::error::connection_reset;
|
||||
net::post(
|
||||
s.ioc.get_executor(),
|
||||
beast::bind_front_handler(std::move(h), ec, 0));
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ namespace test {
|
||||
These streams may be used anywhere an algorithm accepts a
|
||||
reference to a synchronous or asynchronous read or write
|
||||
stream. It is possible to use a test stream in a call to
|
||||
`boost::asio::read_until`, or in a call to
|
||||
`net::read_until`, or in a call to
|
||||
@ref boost::beast::http::async_write for example.
|
||||
|
||||
As with Boost.Asio I/O objects, a @ref stream constructs
|
||||
with a reference to the `boost::asio::io_context` to use for
|
||||
with a reference to the `net::io_context` to use for
|
||||
handling asynchronous I/O. For asynchronous operations, the
|
||||
stream follows the same rules as a traditional asio socket
|
||||
with respect to how completion handlers for asynchronous
|
||||
@@ -120,7 +120,7 @@ class stream
|
||||
flat_buffer b;
|
||||
std::condition_variable cv;
|
||||
std::unique_ptr<read_op_base> op;
|
||||
boost::asio::io_context& ioc;
|
||||
net::io_context& ioc;
|
||||
status code = status::ok;
|
||||
fail_count* fc = nullptr;
|
||||
std::size_t nread = 0;
|
||||
@@ -137,7 +137,7 @@ class stream
|
||||
|
||||
explicit
|
||||
state(
|
||||
boost::asio::io_context& ioc_,
|
||||
net::io_context& ioc_,
|
||||
fail_count* fc_)
|
||||
: ioc(ioc_)
|
||||
, fc(fc_)
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
handler.
|
||||
|
||||
If a connection is established while the stream is destroyed,
|
||||
the peer will see the error `boost::asio::error::connection_reset`
|
||||
the peer will see the error `net::error::connection_reset`
|
||||
when performing any reads or writes.
|
||||
*/
|
||||
~stream();
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
dispatch handlers for any asynchronous operations.
|
||||
*/
|
||||
explicit
|
||||
stream(boost::asio::io_context& ioc);
|
||||
stream(net::io_context& ioc);
|
||||
|
||||
/** Construct a stream
|
||||
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
a simulated failure error will be raised.
|
||||
*/
|
||||
stream(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
fail_count& fc);
|
||||
|
||||
/** Construct a stream
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
including the null terminator.
|
||||
*/
|
||||
stream(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
string_view s);
|
||||
|
||||
/** Construct a stream
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
including the null terminator.
|
||||
*/
|
||||
stream(
|
||||
boost::asio::io_context& ioc,
|
||||
net::io_context& ioc,
|
||||
fail_count& fc,
|
||||
string_view s);
|
||||
|
||||
@@ -261,10 +261,10 @@ public:
|
||||
|
||||
/// The type of the executor associated with the object.
|
||||
using executor_type =
|
||||
boost::asio::io_context::executor_type;
|
||||
net::io_context::executor_type;
|
||||
|
||||
/// Return the executor associated with the object.
|
||||
boost::asio::io_context::executor_type
|
||||
net::io_context::executor_type
|
||||
get_executor() noexcept
|
||||
{
|
||||
return in_->ioc.get_executor();
|
||||
@@ -374,7 +374,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::read` if you need to ensure
|
||||
bytes. Consider using the function `net::read` if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
@returns The number of bytes read.
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::read` if you need to ensure
|
||||
bytes. Consider using the function `net::read` if you need to ensure
|
||||
that the requested amount of data is read before the blocking operation
|
||||
completes.
|
||||
*/
|
||||
@@ -423,7 +423,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `read_some` operation may not read all of the requested number of
|
||||
bytes. Consider using the function `boost::asio::async_read` if you need
|
||||
bytes. Consider using the function `net::async_read` if you need
|
||||
to ensure that the requested amount of data is read before the asynchronous
|
||||
operation completes.
|
||||
*/
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
@throws boost::system::system_error Thrown on failure.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the function `boost::asio::write` if you need to
|
||||
peer. Consider using the function `net::write` if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -466,7 +466,7 @@ public:
|
||||
@returns The number of bytes written.
|
||||
|
||||
@note The `write_some` operation may not transmit all of the data to the
|
||||
peer. Consider using the function `boost::asio::write` if you need to
|
||||
peer. Consider using the function `net::write` if you need to
|
||||
ensure that all data is written before the blocking operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence>
|
||||
@@ -493,7 +493,7 @@ public:
|
||||
); @endcode
|
||||
|
||||
@note The `async_write_some` operation may not transmit all of the data to
|
||||
the peer. Consider using the function `boost::asio::async_write` if you need
|
||||
the peer. Consider using the function `net::async_write` if you need
|
||||
to ensure that all data is written before the asynchronous operation completes.
|
||||
*/
|
||||
template<class ConstBufferSequence, class WriteHandler>
|
||||
|
||||
@@ -38,10 +38,10 @@ namespace beast {
|
||||
void
|
||||
signal_aborted(AsyncReadStream& stream, ReadHandler&& handler)
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
stream.get_executor(),
|
||||
bind_handler(std::forward<ReadHandler>(handler),
|
||||
boost::asio::error::operation_aborted, 0));
|
||||
net::error::operation_aborted, 0));
|
||||
}
|
||||
@endcode
|
||||
|
||||
@@ -90,10 +90,10 @@ bind_handler(Handler&& handler, Args&&... args)
|
||||
void
|
||||
signal_aborted(AsyncReadStream& stream, ReadHandler&& handler)
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
stream.get_executor(),
|
||||
bind_front_handler(std::forward<ReadHandler>(handler),
|
||||
boost::asio::error::operation_aborted, 0));
|
||||
net::error::operation_aborted, 0));
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@@ -31,17 +31,17 @@ namespace beast {
|
||||
is part of the object.
|
||||
|
||||
The use-case for this class is different than that of the
|
||||
`boost::asio::buffered_readstream`. It is designed to facilitate
|
||||
the use of `boost::asio::read_until`, and to allow buffers
|
||||
`net::buffered_readstream`. It is designed to facilitate
|
||||
the use of `net::read_until`, and to allow buffers
|
||||
acquired during detection of handshakes to be made transparently
|
||||
available to callers. A hypothetical implementation of the
|
||||
buffered version of `boost::asio::ssl::stream::async_handshake`
|
||||
buffered version of `net::ssl::stream::async_handshake`
|
||||
could make use of this wrapper.
|
||||
|
||||
Uses:
|
||||
|
||||
@li Transparently leave untouched input acquired in calls
|
||||
to `boost::asio::read_until` behind for subsequent callers.
|
||||
to `net::read_until` behind for subsequent callers.
|
||||
|
||||
@li "Preload" a stream with handshake input data acquired
|
||||
from other sources.
|
||||
@@ -62,7 +62,7 @@ namespace beast {
|
||||
// part up to the end of the delimiter.
|
||||
//
|
||||
std::size_t bytes_transferred =
|
||||
boost::asio::read_until(
|
||||
net::read_until(
|
||||
stream.next_layer(), stream.buffer(), "\r\n\r\n");
|
||||
|
||||
// Use buffers_prefix() to limit the input
|
||||
@@ -92,7 +92,7 @@ template<class Stream, class DynamicBuffer>
|
||||
class buffered_read_stream
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
|
||||
template<class Buffers, class Handler>
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class MutableBufferSequence, class ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -355,7 +355,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class ConstBufferSequence, class WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace beast {
|
||||
template<class MutableBufferSequence>
|
||||
class buffers_adapter
|
||||
{
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<MutableBufferSequence>::value,
|
||||
static_assert(net::is_mutable_buffer_sequence<MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
|
||||
using iter_type = typename
|
||||
|
||||
@@ -30,8 +30,8 @@ public:
|
||||
/** The type of buffer returned when dereferencing an iterator.
|
||||
|
||||
If every buffer sequence in the view is a @b MutableBufferSequence,
|
||||
then `value_type` will be `boost::asio::mutable_buffer`.
|
||||
Otherwise, `value_type` will be `boost::asio::const_buffer`.
|
||||
then `value_type` will be `net::mutable_buffer`.
|
||||
Otherwise, `value_type` will be `net::const_buffer`.
|
||||
*/
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
using value_type = __implementation_defined__;
|
||||
|
||||
@@ -60,9 +60,9 @@ public:
|
||||
using value_type = typename std::conditional<
|
||||
std::is_convertible<typename
|
||||
std::iterator_traits<iter_type>::value_type,
|
||||
boost::asio::mutable_buffer>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
/// A bidirectional iterator type that may be used to read elements.
|
||||
@@ -139,9 +139,9 @@ public:
|
||||
bytes of the original buffer.
|
||||
*/
|
||||
inline
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
buffers_prefix(std::size_t size,
|
||||
boost::asio::const_buffer buffer)
|
||||
net::const_buffer buffer)
|
||||
{
|
||||
return {buffer.data(),
|
||||
(std::min)(size, buffer.size())};
|
||||
@@ -162,9 +162,9 @@ buffers_prefix(std::size_t size,
|
||||
of the original buffer.
|
||||
*/
|
||||
inline
|
||||
boost::asio::mutable_buffer
|
||||
net::mutable_buffer
|
||||
buffers_prefix(std::size_t size,
|
||||
boost::asio::mutable_buffer buffer)
|
||||
net::mutable_buffer buffer)
|
||||
{
|
||||
return {buffer.data(),
|
||||
(std::min)(size, buffer.size())};
|
||||
@@ -193,16 +193,16 @@ buffers_prefix_view<BufferSequence>
|
||||
inline
|
||||
typename std::enable_if<
|
||||
! std::is_same<BufferSequence,
|
||||
boost::asio::const_buffer>::value &&
|
||||
net::const_buffer>::value &&
|
||||
! std::is_same<BufferSequence,
|
||||
boost::asio::mutable_buffer>::value,
|
||||
net::mutable_buffer>::value,
|
||||
buffers_prefix_view<BufferSequence>>::type
|
||||
#endif
|
||||
buffers_prefix(std::size_t size, BufferSequence const& buffers)
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_const_buffer_sequence<BufferSequence>::value ||
|
||||
boost::asio::is_mutable_buffer_sequence<BufferSequence>::value,
|
||||
net::is_const_buffer_sequence<BufferSequence>::value ||
|
||||
net::is_mutable_buffer_sequence<BufferSequence>::value,
|
||||
"BufferSequence requirements not met");
|
||||
return buffers_prefix_view<BufferSequence>(size, buffers);
|
||||
}
|
||||
@@ -219,14 +219,14 @@ buffers_prefix(std::size_t size, BufferSequence const& buffers)
|
||||
*/
|
||||
template<class BufferSequence>
|
||||
typename std::conditional<
|
||||
boost::asio::is_mutable_buffer_sequence<BufferSequence>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type
|
||||
net::is_mutable_buffer_sequence<BufferSequence>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type
|
||||
buffers_front(BufferSequence const& buffers)
|
||||
{
|
||||
auto const first =
|
||||
boost::asio::buffer_sequence_begin(buffers);
|
||||
if(first == boost::asio::buffer_sequence_end(buffers))
|
||||
net::buffer_sequence_begin(buffers);
|
||||
if(first == net::buffer_sequence_end(buffers))
|
||||
return {};
|
||||
return *first;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ detail::buffers_range_adaptor<ConstBufferSequence>
|
||||
buffers_range(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
net::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
return detail::buffers_range_adaptor<ConstBufferSequence>(buffers);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ detail::buffers_range_adaptor<ConstBufferSequence const&>
|
||||
buffers_range(std::reference_wrapper<ConstBufferSequence> buffers)
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
net::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
return detail::buffers_range_adaptor<ConstBufferSequence const&>(buffers.get());
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace beast {
|
||||
void send(SyncWriteStream& stream, ConstBufferSequence const& buffers)
|
||||
{
|
||||
buffers_suffix<ConstBufferSequence> bs{buffers};
|
||||
while(boost::asio::buffer_size(bs) > 0)
|
||||
while(net::buffer_size(bs) > 0)
|
||||
bs.consume(stream.write_some(bs));
|
||||
}
|
||||
@endcode
|
||||
@@ -67,7 +67,7 @@ class buffers_suffix
|
||||
buffers_suffix(Deduced&& other, std::size_t dist)
|
||||
: bs_(std::forward<Deduced>(other).bs_)
|
||||
, begin_(std::next(
|
||||
boost::asio::buffer_sequence_begin(bs_),
|
||||
net::buffer_sequence_begin(bs_),
|
||||
dist))
|
||||
, skip_(other.skip_)
|
||||
{
|
||||
@@ -77,9 +77,9 @@ public:
|
||||
/** The type for each element in the list of buffers.
|
||||
|
||||
If the buffers in the underlying sequence are convertible to
|
||||
`boost::asio::mutable_buffer`, then this type will be
|
||||
`boost::asio::mutable_buffer`, else this type will be
|
||||
`boost::asio::const_buffer`.
|
||||
`net::mutable_buffer`, then this type will be
|
||||
`net::mutable_buffer`, else this type will be
|
||||
`net::const_buffer`.
|
||||
*/
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
using value_type = __implementation_defined__;
|
||||
@@ -87,9 +87,9 @@ public:
|
||||
using value_type = typename std::conditional<
|
||||
std::is_convertible<typename
|
||||
std::iterator_traits<iter_type>::value_type,
|
||||
boost::asio::mutable_buffer>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
#endif
|
||||
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
|
||||
@@ -45,10 +45,10 @@ std::string
|
||||
buffers_to_string(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
net::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
std::string result;
|
||||
result.reserve(boost::asio::buffer_size(buffers));
|
||||
result.reserve(net::buffer_size(buffers));
|
||||
for(auto const buffer : buffers_range(std::ref(buffers)))
|
||||
result.append(static_cast<char const*>(
|
||||
buffer.data()), buffer.size());
|
||||
|
||||
@@ -40,7 +40,7 @@ class bind_wrapper
|
||||
// Can't friend partial specializations,
|
||||
// so we just friend the whole thing.
|
||||
template<class T, class Executor>
|
||||
friend struct boost::asio::associated_executor;
|
||||
friend struct net::associated_executor;
|
||||
|
||||
template<class Arg, class Vals>
|
||||
static
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
using result_type = void;
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
bind_wrapper(bind_wrapper&&) = default;
|
||||
bind_wrapper(bind_wrapper const&) = default;
|
||||
@@ -140,14 +140,14 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation(bind_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, bind_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -194,13 +194,13 @@ class bind_front_wrapper<Handler>
|
||||
// Can't friend partial specializations,
|
||||
// so we just friend the whole thing.
|
||||
template<class T, class Executor>
|
||||
friend struct boost::asio::associated_executor;
|
||||
friend struct net::associated_executor;
|
||||
|
||||
public:
|
||||
using result_type = void;
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
bind_front_wrapper(bind_front_wrapper&&) = default;
|
||||
bind_front_wrapper(bind_front_wrapper const&) = default;
|
||||
@@ -215,14 +215,14 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation(bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -251,13 +251,13 @@ class bind_front_wrapper<Handler, Arg>
|
||||
// Can't friend partial specializations,
|
||||
// so we just friend the whole thing.
|
||||
template<class T, class Executor>
|
||||
friend struct boost::asio::associated_executor;
|
||||
friend struct net::associated_executor;
|
||||
|
||||
public:
|
||||
using result_type = void;
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
bind_front_wrapper(bind_front_wrapper&&) = default;
|
||||
bind_front_wrapper(bind_front_wrapper const&) = default;
|
||||
@@ -273,14 +273,14 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation(bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -311,13 +311,13 @@ class bind_front_wrapper<Handler, Arg1, Arg2>
|
||||
// Can't friend partial specializations,
|
||||
// so we just friend the whole thing.
|
||||
template<class T, class Executor>
|
||||
friend struct boost::asio::associated_executor;
|
||||
friend struct net::associated_executor;
|
||||
|
||||
public:
|
||||
using result_type = void;
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
bind_front_wrapper(bind_front_wrapper&&) = default;
|
||||
bind_front_wrapper(bind_front_wrapper const&) = default;
|
||||
@@ -334,14 +334,14 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation(bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ class bind_front_wrapper<Handler, Arg1, Arg2, Arg3, Args...>
|
||||
// Can't friend partial specializations,
|
||||
// so we just friend the whole thing.
|
||||
template<class T, class Executor>
|
||||
friend struct boost::asio::associated_executor;
|
||||
friend struct net::associated_executor;
|
||||
|
||||
template<std::size_t... I, class... Ts>
|
||||
void
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
using result_type = void;
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
bind_front_wrapper(bind_front_wrapper&&) = default;
|
||||
bind_front_wrapper(bind_front_wrapper const&) = default;
|
||||
@@ -416,14 +416,14 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation(bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ public:
|
||||
using result_type = void;
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
bind_front_wrapper(bind_front_wrapper&&) = default;
|
||||
bind_front_wrapper(bind_front_wrapper const&) = default;
|
||||
@@ -478,14 +478,14 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return boost::asio::get_associated_allocator(h_);
|
||||
return net::get_associated_allocator(h_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
asio_handler_is_continuation(bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(std::addressof(w->h_));
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, bind_front_wrapper* w)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(w->h_));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ public:
|
||||
typename std::iterator_traits<
|
||||
typename detail::buffer_sequence_iterator<
|
||||
BufferSequence>::type>::value_type,
|
||||
boost::asio::mutable_buffer>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
#endif
|
||||
|
||||
class const_iterator
|
||||
@@ -124,13 +124,13 @@ public:
|
||||
const_iterator
|
||||
begin() const noexcept
|
||||
{
|
||||
return boost::asio::buffer_sequence_begin(b_);
|
||||
return net::buffer_sequence_begin(b_);
|
||||
}
|
||||
|
||||
const_iterator
|
||||
end() const noexcept
|
||||
{
|
||||
return boost::asio::buffer_sequence_end(b_);
|
||||
return net::buffer_sequence_end(b_);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -42,13 +42,13 @@ public:
|
||||
const_iterator
|
||||
begin() const
|
||||
{
|
||||
return boost::asio::buffer_sequence_begin(*buffers_);
|
||||
return net::buffer_sequence_begin(*buffers_);
|
||||
}
|
||||
|
||||
const_iterator
|
||||
end() const
|
||||
{
|
||||
return boost::asio::buffer_sequence_end(*buffers_);
|
||||
return net::buffer_sequence_end(*buffers_);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -262,21 +262,21 @@ struct BufferSequence
|
||||
const_iterator end() const noexcept;
|
||||
};
|
||||
using ConstBufferSequence =
|
||||
BufferSequence<boost::asio::const_buffer>;
|
||||
BufferSequence<net::const_buffer>;
|
||||
using MutableBufferSequence =
|
||||
BufferSequence<boost::asio::mutable_buffer>;
|
||||
BufferSequence<net::mutable_buffer>;
|
||||
|
||||
template<class B1, class... Bn>
|
||||
struct is_all_const_buffer_sequence
|
||||
: std::integral_constant<bool,
|
||||
boost::asio::is_const_buffer_sequence<B1>::value &&
|
||||
net::is_const_buffer_sequence<B1>::value &&
|
||||
is_all_const_buffer_sequence<Bn...>::value>
|
||||
{
|
||||
};
|
||||
|
||||
template<class B>
|
||||
struct is_all_const_buffer_sequence<B>
|
||||
: boost::asio::is_const_buffer_sequence<B>
|
||||
: net::is_const_buffer_sequence<B>
|
||||
{
|
||||
};
|
||||
|
||||
@@ -288,22 +288,22 @@ template<class B>
|
||||
struct buffer_sequence_iterator
|
||||
{
|
||||
using type = decltype(
|
||||
boost::asio::buffer_sequence_begin(
|
||||
net::buffer_sequence_begin(
|
||||
std::declval<B const&>()));
|
||||
};
|
||||
|
||||
template<>
|
||||
struct buffer_sequence_iterator<
|
||||
boost::asio::const_buffer>
|
||||
net::const_buffer>
|
||||
{
|
||||
using type = boost::asio::const_buffer const*;
|
||||
using type = net::const_buffer const*;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct buffer_sequence_iterator<
|
||||
boost::asio::mutable_buffer>
|
||||
net::mutable_buffer>
|
||||
{
|
||||
using type = boost::asio::mutable_buffer const*;
|
||||
using type = net::mutable_buffer const*;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -320,16 +320,16 @@ struct buffer_sequence_value_type
|
||||
|
||||
template<>
|
||||
struct buffer_sequence_value_type<
|
||||
boost::asio::const_buffer const*>
|
||||
net::const_buffer const*>
|
||||
{
|
||||
using type = boost::asio::const_buffer;
|
||||
using type = net::const_buffer;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct buffer_sequence_value_type<
|
||||
boost::asio::mutable_buffer const*>
|
||||
net::mutable_buffer const*>
|
||||
{
|
||||
using type = boost::asio::mutable_buffer;
|
||||
using type = net::mutable_buffer;
|
||||
};
|
||||
|
||||
//
|
||||
@@ -341,9 +341,9 @@ struct common_buffers_type
|
||||
mp11::mp_and<
|
||||
boost::is_convertible<
|
||||
typename buffer_sequence_value_type<Bn>::type,
|
||||
boost::asio::mutable_buffer>...>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer>...>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
};
|
||||
|
||||
// Types that meet the requirements,
|
||||
@@ -366,7 +366,7 @@ using WriteHandler = StreamHandler;
|
||||
static_assert(boost::beast::is_completion_handler< \
|
||||
BOOST_ASIO_HANDLER_TYPE(type, sig), sig>::value, \
|
||||
"CompletionHandler signature requirements not met"); \
|
||||
boost::asio::async_completion<type, sig> init{handler}
|
||||
net::async_completion<type, sig> init{handler}
|
||||
|
||||
} // detail
|
||||
} // beast
|
||||
|
||||
@@ -281,13 +281,13 @@ public:
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/// The ConstBufferSequence used to represent the readable bytes.
|
||||
using const_buffers_type = boost::asio::const_buffer;
|
||||
using const_buffers_type = net::const_buffer;
|
||||
|
||||
/// The MutableBufferSequence used to represent the readable bytes.
|
||||
using mutable_data_type = boost::asio::mutable_buffer;
|
||||
using mutable_data_type = net::mutable_buffer;
|
||||
|
||||
/// The MutableBufferSequence used to represent the writable bytes.
|
||||
using mutable_buffers_type = boost::asio::mutable_buffer;
|
||||
using mutable_buffers_type = net::mutable_buffer;
|
||||
|
||||
/// Returns the number of readable bytes.
|
||||
std::size_t
|
||||
|
||||
@@ -92,13 +92,13 @@ public:
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/// The ConstBufferSequence used to represent the readable bytes.
|
||||
using const_buffers_type = boost::asio::const_buffer;
|
||||
using const_buffers_type = net::const_buffer;
|
||||
|
||||
/// The MutableBufferSequence used to represent the readable bytes.
|
||||
using mutable_data_type = boost::asio::mutable_buffer;
|
||||
using mutable_data_type = net::mutable_buffer;
|
||||
|
||||
/// The MutableBufferSequence used to represent the writable bytes.
|
||||
using mutable_buffers_type = boost::asio::mutable_buffer;
|
||||
using mutable_buffers_type = net::mutable_buffer;
|
||||
|
||||
/// Returns the number of readable bytes.
|
||||
std::size_t
|
||||
|
||||
@@ -33,7 +33,7 @@ class buffered_read_stream<
|
||||
Stream, DynamicBuffer>::read_some_op
|
||||
{
|
||||
buffered_read_stream& s_;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg_;
|
||||
MutableBufferSequence b_;
|
||||
Handler h_;
|
||||
@@ -55,22 +55,22 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type =
|
||||
boost::asio::associated_executor_t<Handler, decltype(
|
||||
net::associated_executor_t<Handler, decltype(
|
||||
std::declval<buffered_read_stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(read_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -124,7 +124,7 @@ read_some_op<MutableBufferSequence, Handler>::operator()(
|
||||
|
||||
}
|
||||
step_ = 3;
|
||||
return boost::asio::post(
|
||||
return net::post(
|
||||
s_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec, 0));
|
||||
|
||||
@@ -138,7 +138,7 @@ read_some_op<MutableBufferSequence, Handler>::operator()(
|
||||
|
||||
case 3:
|
||||
bytes_transferred =
|
||||
boost::asio::buffer_copy(b_, s_.buffer_.data());
|
||||
net::buffer_copy(b_, s_.buffer_.data());
|
||||
s_.buffer_.consume(bytes_transferred);
|
||||
break;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ async_write_some(
|
||||
{
|
||||
static_assert(is_async_write_stream<next_layer_type>::value,
|
||||
"AsyncWriteStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(is_completion_handler<WriteHandler,
|
||||
@@ -185,7 +185,7 @@ read_some(
|
||||
{
|
||||
static_assert(is_sync_read_stream<next_layer_type>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -204,11 +204,11 @@ read_some(MutableBufferSequence const& buffers,
|
||||
{
|
||||
static_assert(is_sync_read_stream<next_layer_type>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::buffer_copy;
|
||||
if(buffer_.size() == 0)
|
||||
{
|
||||
if(capacity_ == 0)
|
||||
@@ -240,7 +240,7 @@ async_read_some(
|
||||
{
|
||||
static_assert(is_async_read_stream<next_layer_type>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
if(buffer_.size() == 0 && capacity_ == 0)
|
||||
|
||||
@@ -29,7 +29,7 @@ class buffers_adapter<MutableBufferSequence>::
|
||||
buffers_adapter const* b_;
|
||||
|
||||
public:
|
||||
using value_type = boost::asio::const_buffer;
|
||||
using value_type = net::const_buffer;
|
||||
|
||||
class const_iterator;
|
||||
|
||||
@@ -62,7 +62,7 @@ class buffers_adapter<MutableBufferSequence>::
|
||||
buffers_adapter const* b_ = nullptr;
|
||||
|
||||
public:
|
||||
using value_type = boost::asio::const_buffer;
|
||||
using value_type = net::const_buffer;
|
||||
using pointer = value_type const*;
|
||||
using reference = value_type;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
{
|
||||
value_type const b = *it_;
|
||||
return value_type{b.data(),
|
||||
(b_->out_ == boost::asio::buffer_sequence_end(b_->bs_) ||
|
||||
(b_->out_ == net::buffer_sequence_end(b_->bs_) ||
|
||||
it_ != b_->out_) ? b.size() : b_->out_pos_} +
|
||||
(it_ == b_->begin_ ? b_->in_pos_ : 0);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ mutable_buffers_type
|
||||
buffers_adapter const* b_;
|
||||
|
||||
public:
|
||||
using value_type = boost::asio::mutable_buffer;
|
||||
using value_type = net::mutable_buffer;
|
||||
|
||||
class const_iterator;
|
||||
|
||||
@@ -215,7 +215,7 @@ mutable_buffers_type::const_iterator
|
||||
buffers_adapter const* b_ = nullptr;
|
||||
|
||||
public:
|
||||
using value_type = boost::asio::mutable_buffer;
|
||||
using value_type = net::mutable_buffer;
|
||||
using pointer = value_type const*;
|
||||
using reference = value_type;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -344,9 +344,9 @@ template<class MutableBufferSequence>
|
||||
buffers_adapter<MutableBufferSequence>::
|
||||
buffers_adapter(buffers_adapter&& other)
|
||||
: buffers_adapter(std::move(other),
|
||||
std::distance<iter_type>(boost::asio::buffer_sequence_begin(other.bs_), other.begin_),
|
||||
std::distance<iter_type>(boost::asio::buffer_sequence_begin(other.bs_), other.out_),
|
||||
std::distance<iter_type>(boost::asio::buffer_sequence_begin(other.bs_), other.end_))
|
||||
std::distance<iter_type>(net::buffer_sequence_begin(other.bs_), other.begin_),
|
||||
std::distance<iter_type>(net::buffer_sequence_begin(other.bs_), other.out_),
|
||||
std::distance<iter_type>(net::buffer_sequence_begin(other.bs_), other.end_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -354,9 +354,9 @@ template<class MutableBufferSequence>
|
||||
buffers_adapter<MutableBufferSequence>::
|
||||
buffers_adapter(buffers_adapter const& other)
|
||||
: buffers_adapter(other,
|
||||
std::distance<iter_type>(boost::asio::buffer_sequence_begin(other.bs_), other.begin_),
|
||||
std::distance<iter_type>(boost::asio::buffer_sequence_begin(other.bs_), other.out_),
|
||||
std::distance<iter_type>(boost::asio::buffer_sequence_begin(other.bs_), other.end_))
|
||||
std::distance<iter_type>(net::buffer_sequence_begin(other.bs_), other.begin_),
|
||||
std::distance<iter_type>(net::buffer_sequence_begin(other.bs_), other.out_),
|
||||
std::distance<iter_type>(net::buffer_sequence_begin(other.bs_), other.end_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -367,18 +367,18 @@ operator=(buffers_adapter&& other) ->
|
||||
buffers_adapter&
|
||||
{
|
||||
auto const nbegin = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.begin_);
|
||||
auto const nout = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.out_);
|
||||
auto const nend = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.end_);
|
||||
bs_ = std::move(other.bs_);
|
||||
begin_ = std::next(boost::asio::buffer_sequence_begin(bs_), nbegin);
|
||||
out_ = std::next(boost::asio::buffer_sequence_begin(bs_), nout);
|
||||
end_ = std::next(boost::asio::buffer_sequence_begin(bs_), nend);
|
||||
begin_ = std::next(net::buffer_sequence_begin(bs_), nbegin);
|
||||
out_ = std::next(net::buffer_sequence_begin(bs_), nout);
|
||||
end_ = std::next(net::buffer_sequence_begin(bs_), nend);
|
||||
max_size_ = other.max_size_;
|
||||
in_pos_ = other.in_pos_;
|
||||
in_size_ = other.in_size_;
|
||||
@@ -394,18 +394,18 @@ operator=(buffers_adapter const& other) ->
|
||||
buffers_adapter&
|
||||
{
|
||||
auto const nbegin = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.begin_);
|
||||
auto const nout = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.out_);
|
||||
auto const nend = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.end_);
|
||||
bs_ = other.bs_;
|
||||
begin_ = std::next(boost::asio::buffer_sequence_begin(bs_), nbegin);
|
||||
out_ = std::next(boost::asio::buffer_sequence_begin(bs_), nout);
|
||||
end_ = std::next(boost::asio::buffer_sequence_begin(bs_), nend);
|
||||
begin_ = std::next(net::buffer_sequence_begin(bs_), nbegin);
|
||||
out_ = std::next(net::buffer_sequence_begin(bs_), nout);
|
||||
end_ = std::next(net::buffer_sequence_begin(bs_), nend);
|
||||
max_size_ = other.max_size_;
|
||||
in_pos_ = other.in_pos_;
|
||||
in_size_ = other.in_size_;
|
||||
@@ -418,10 +418,10 @@ template<class MutableBufferSequence>
|
||||
buffers_adapter<MutableBufferSequence>::
|
||||
buffers_adapter(MutableBufferSequence const& bs)
|
||||
: bs_(bs)
|
||||
, begin_(boost::asio::buffer_sequence_begin(bs_))
|
||||
, out_ (boost::asio::buffer_sequence_begin(bs_))
|
||||
, end_ (boost::asio::buffer_sequence_begin(bs_))
|
||||
, max_size_(boost::asio::buffer_size(bs_))
|
||||
, begin_(net::buffer_sequence_begin(bs_))
|
||||
, out_ (net::buffer_sequence_begin(bs_))
|
||||
, end_ (net::buffer_sequence_begin(bs_))
|
||||
, max_size_(net::buffer_size(bs_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -430,10 +430,10 @@ template<class... Args>
|
||||
buffers_adapter<MutableBufferSequence>::
|
||||
buffers_adapter(boost::in_place_init_t, Args&&... args)
|
||||
: bs_{std::forward<Args>(args)...}
|
||||
, begin_(boost::asio::buffer_sequence_begin(bs_))
|
||||
, out_ (boost::asio::buffer_sequence_begin(bs_))
|
||||
, end_ (boost::asio::buffer_sequence_begin(bs_))
|
||||
, max_size_(boost::asio::buffer_size(bs_))
|
||||
, begin_(net::buffer_sequence_begin(bs_))
|
||||
, out_ (net::buffer_sequence_begin(bs_))
|
||||
, end_ (net::buffer_sequence_begin(bs_))
|
||||
, max_size_(net::buffer_size(bs_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -443,16 +443,16 @@ buffers_adapter<MutableBufferSequence>::
|
||||
prepare(std::size_t n) ->
|
||||
mutable_buffers_type
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
end_ = out_;
|
||||
if(end_ != boost::asio::buffer_sequence_end(bs_))
|
||||
if(end_ != net::buffer_sequence_end(bs_))
|
||||
{
|
||||
auto size = buffer_size(*end_) - out_pos_;
|
||||
if(n > size)
|
||||
{
|
||||
n -= size;
|
||||
while(++end_ !=
|
||||
boost::asio::buffer_sequence_end(bs_))
|
||||
net::buffer_sequence_end(bs_))
|
||||
{
|
||||
size = buffer_size(*end_);
|
||||
if(n < size)
|
||||
@@ -484,7 +484,7 @@ void
|
||||
buffers_adapter<MutableBufferSequence>::
|
||||
commit(std::size_t n)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
if(out_ == end_)
|
||||
return;
|
||||
auto const last = std::prev(end_);
|
||||
@@ -530,7 +530,7 @@ void
|
||||
buffers_adapter<MutableBufferSequence>::
|
||||
consume(std::size_t n)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
while(begin_ != out_)
|
||||
{
|
||||
auto const avail =
|
||||
|
||||
@@ -32,7 +32,7 @@ struct buffers_cat_view_iterator_base
|
||||
{
|
||||
char unused = 0; // make g++8 happy
|
||||
|
||||
boost::asio::mutable_buffer
|
||||
net::mutable_buffer
|
||||
operator*() const
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::logic_error{
|
||||
@@ -119,11 +119,11 @@ private:
|
||||
void
|
||||
next(C<I> const&)
|
||||
{
|
||||
if(boost::asio::buffer_size(
|
||||
if(net::buffer_size(
|
||||
detail::get<I>(*bn_)) != 0)
|
||||
{
|
||||
it_.template emplace<I+1>(
|
||||
boost::asio::buffer_sequence_begin(
|
||||
net::buffer_sequence_begin(
|
||||
detail::get<I>(*bn_)));
|
||||
return;
|
||||
}
|
||||
@@ -142,11 +142,11 @@ private:
|
||||
void
|
||||
prev(C<I> const&)
|
||||
{
|
||||
if(boost::asio::buffer_size(
|
||||
if(net::buffer_size(
|
||||
detail::get<I>(*bn_)) != 0)
|
||||
{
|
||||
it_.template emplace<I+1>(
|
||||
boost::asio::buffer_sequence_end(
|
||||
net::buffer_sequence_end(
|
||||
detail::get<I>(*bn_)));
|
||||
return;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ private:
|
||||
{
|
||||
auto constexpr I = 0;
|
||||
it_.template emplace<I+1>(
|
||||
boost::asio::buffer_sequence_end(
|
||||
net::buffer_sequence_end(
|
||||
detail::get<I>(*bn_)));
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ private:
|
||||
operator()(mp11::mp_size_t<I>)
|
||||
{
|
||||
auto& it = self.it_.template get<I>();
|
||||
if (++it == boost::asio::buffer_sequence_end(
|
||||
if (++it == net::buffer_sequence_end(
|
||||
detail::get<I - 1>(*self.bn_)))
|
||||
self.next(C<I>());
|
||||
}
|
||||
@@ -227,7 +227,7 @@ private:
|
||||
if(it_.index() == I+1)
|
||||
{
|
||||
if(it_.template get<I+1>() !=
|
||||
boost::asio::buffer_sequence_begin(
|
||||
net::buffer_sequence_begin(
|
||||
detail::get<I>(*bn_)))
|
||||
{
|
||||
--it_.template get<I+1>();
|
||||
@@ -243,7 +243,7 @@ private:
|
||||
{
|
||||
auto constexpr I = 0;
|
||||
if(it_.template get<I+1>() !=
|
||||
boost::asio::buffer_sequence_begin(
|
||||
net::buffer_sequence_begin(
|
||||
detail::get<I>(*bn_)))
|
||||
{
|
||||
--it_.template get<I+1>();
|
||||
|
||||
@@ -23,18 +23,18 @@ namespace beast {
|
||||
namespace detail {
|
||||
|
||||
inline
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
buffers_prefix(std::size_t size,
|
||||
boost::asio::const_buffer buffer)
|
||||
net::const_buffer buffer)
|
||||
{
|
||||
return {buffer.data(),
|
||||
(std::min)(size, buffer.size())};
|
||||
}
|
||||
|
||||
inline
|
||||
boost::asio::mutable_buffer
|
||||
net::mutable_buffer
|
||||
buffers_prefix(std::size_t size,
|
||||
boost::asio::mutable_buffer buffer)
|
||||
net::mutable_buffer buffer)
|
||||
{
|
||||
return {buffer.data(),
|
||||
(std::min)(size, buffer.size())};
|
||||
@@ -55,9 +55,9 @@ public:
|
||||
using value_type = typename std::conditional<
|
||||
boost::is_convertible<typename
|
||||
std::iterator_traits<iter_type>::value_type,
|
||||
boost::asio::mutable_buffer>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
using pointer = value_type const*;
|
||||
using reference = value_type;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
const_iterator&
|
||||
operator++()
|
||||
{
|
||||
remain_ -= boost::asio::buffer_size(*it_++);
|
||||
remain_ -= net::buffer_size(*it_++);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -115,14 +115,14 @@ public:
|
||||
operator++(int)
|
||||
{
|
||||
auto temp = *this;
|
||||
remain_ -= boost::asio::buffer_size(*it_++);
|
||||
remain_ -= net::buffer_size(*it_++);
|
||||
return temp;
|
||||
}
|
||||
|
||||
const_iterator&
|
||||
operator--()
|
||||
{
|
||||
remain_ += boost::asio::buffer_size(*--it_);
|
||||
remain_ += net::buffer_size(*--it_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
operator--(int)
|
||||
{
|
||||
auto temp = *this;
|
||||
remain_ += boost::asio::buffer_size(*--it_);
|
||||
remain_ += net::buffer_size(*--it_);
|
||||
return temp;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
std::false_type)
|
||||
: b_(&b)
|
||||
, remain_(b_->size_)
|
||||
, it_(boost::asio::buffer_sequence_begin(b_->bs_))
|
||||
, it_(net::buffer_sequence_begin(b_->bs_))
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -161,12 +161,12 @@ setup(std::size_t size)
|
||||
{
|
||||
size_ = 0;
|
||||
remain_ = 0;
|
||||
end_ = boost::asio::buffer_sequence_begin(bs_);
|
||||
end_ = net::buffer_sequence_begin(bs_);
|
||||
auto const last = bs_.end();
|
||||
while(end_ != last)
|
||||
{
|
||||
auto const len =
|
||||
boost::asio::buffer_size(*end_++);
|
||||
net::buffer_size(*end_++);
|
||||
if(len >= size)
|
||||
{
|
||||
size_ += size;
|
||||
@@ -183,7 +183,7 @@ buffers_prefix_view<BufferSequence>::
|
||||
buffers_prefix_view(buffers_prefix_view&& other)
|
||||
: buffers_prefix_view(std::move(other),
|
||||
std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.end_))
|
||||
{
|
||||
}
|
||||
@@ -193,7 +193,7 @@ buffers_prefix_view<BufferSequence>::
|
||||
buffers_prefix_view(buffers_prefix_view const& other)
|
||||
: buffers_prefix_view(other,
|
||||
std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.end_))
|
||||
{
|
||||
}
|
||||
@@ -205,13 +205,13 @@ operator=(buffers_prefix_view&& other) ->
|
||||
buffers_prefix_view&
|
||||
{
|
||||
auto const dist = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.end_);
|
||||
bs_ = std::move(other.bs_);
|
||||
size_ = other.size_;
|
||||
remain_ = other.remain_;
|
||||
end_ = std::next(
|
||||
boost::asio::buffer_sequence_begin(bs_),
|
||||
net::buffer_sequence_begin(bs_),
|
||||
dist);
|
||||
return *this;
|
||||
}
|
||||
@@ -223,13 +223,13 @@ operator=(buffers_prefix_view const& other) ->
|
||||
buffers_prefix_view&
|
||||
{
|
||||
auto const dist = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.end_);
|
||||
bs_ = other.bs_;
|
||||
size_ = other.size_;
|
||||
remain_ = other.remain_;
|
||||
end_ = std::next(
|
||||
boost::asio::buffer_sequence_begin(bs_),
|
||||
net::buffer_sequence_begin(bs_),
|
||||
dist);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ public:
|
||||
using value_type = typename std::conditional<
|
||||
boost::is_convertible<typename
|
||||
std::iterator_traits<iter_type>::value_type,
|
||||
boost::asio::mutable_buffer>::value,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer>::value,
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
using pointer = value_type const*;
|
||||
using reference = value_type;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -58,11 +58,11 @@ public:
|
||||
(b_ == nullptr) ?
|
||||
(
|
||||
other.b_ == nullptr ||
|
||||
other.it_ == boost::asio::buffer_sequence_end(other.b_->bs_)
|
||||
other.it_ == net::buffer_sequence_end(other.b_->bs_)
|
||||
):(
|
||||
(other.b_ == nullptr) ?
|
||||
(
|
||||
it_ == boost::asio::buffer_sequence_end(b_->bs_)
|
||||
it_ == net::buffer_sequence_end(b_->bs_)
|
||||
): (
|
||||
b_ == other.b_ &&
|
||||
it_ == other.it_
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
template<class Buffers>
|
||||
buffers_suffix<Buffers>::
|
||||
buffers_suffix()
|
||||
: begin_(boost::asio::buffer_sequence_begin(bs_))
|
||||
: begin_(net::buffer_sequence_begin(bs_))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ buffers_suffix<Buffers>::
|
||||
buffers_suffix(buffers_suffix&& other)
|
||||
: buffers_suffix(std::move(other),
|
||||
std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(
|
||||
net::buffer_sequence_begin(
|
||||
other.bs_), other.begin_))
|
||||
{
|
||||
}
|
||||
@@ -150,7 +150,7 @@ buffers_suffix<Buffers>::
|
||||
buffers_suffix(buffers_suffix const& other)
|
||||
: buffers_suffix(other,
|
||||
std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(
|
||||
net::buffer_sequence_begin(
|
||||
other.bs_), other.begin_))
|
||||
{
|
||||
}
|
||||
@@ -159,11 +159,11 @@ template<class Buffers>
|
||||
buffers_suffix<Buffers>::
|
||||
buffers_suffix(Buffers const& bs)
|
||||
: bs_(bs)
|
||||
, begin_(boost::asio::buffer_sequence_begin(bs_))
|
||||
, begin_(net::buffer_sequence_begin(bs_))
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_const_buffer_sequence<Buffers>::value||
|
||||
boost::asio::is_mutable_buffer_sequence<Buffers>::value,
|
||||
net::is_const_buffer_sequence<Buffers>::value||
|
||||
net::is_mutable_buffer_sequence<Buffers>::value,
|
||||
"BufferSequence requirements not met");
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ template<class... Args>
|
||||
buffers_suffix<Buffers>::
|
||||
buffers_suffix(boost::in_place_init_t, Args&&... args)
|
||||
: bs_(std::forward<Args>(args)...)
|
||||
, begin_(boost::asio::buffer_sequence_begin(bs_))
|
||||
, begin_(net::buffer_sequence_begin(bs_))
|
||||
{
|
||||
static_assert(sizeof...(Args) > 0,
|
||||
"Missing constructor arguments");
|
||||
@@ -188,11 +188,11 @@ operator=(buffers_suffix&& other) ->
|
||||
buffers_suffix&
|
||||
{
|
||||
auto const dist = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.begin_);
|
||||
bs_ = std::move(other.bs_);
|
||||
begin_ = std::next(
|
||||
boost::asio::buffer_sequence_begin(bs_),
|
||||
net::buffer_sequence_begin(bs_),
|
||||
dist);
|
||||
skip_ = other.skip_;
|
||||
return *this;
|
||||
@@ -205,11 +205,11 @@ operator=(buffers_suffix const& other) ->
|
||||
buffers_suffix&
|
||||
{
|
||||
auto const dist = std::distance<iter_type>(
|
||||
boost::asio::buffer_sequence_begin(other.bs_),
|
||||
net::buffer_sequence_begin(other.bs_),
|
||||
other.begin_);
|
||||
bs_ = other.bs_;
|
||||
begin_ = std::next(
|
||||
boost::asio::buffer_sequence_begin(bs_), dist);
|
||||
net::buffer_sequence_begin(bs_), dist);
|
||||
skip_ = other.skip_;
|
||||
return *this;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ end() const ->
|
||||
const_iterator
|
||||
{
|
||||
return const_iterator{*this,
|
||||
boost::asio::buffer_sequence_end(bs_)};
|
||||
net::buffer_sequence_end(bs_)};
|
||||
}
|
||||
|
||||
template<class Buffers>
|
||||
@@ -240,9 +240,9 @@ void
|
||||
buffers_suffix<Buffers>::
|
||||
consume(std::size_t amount)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
auto const end =
|
||||
boost::asio::buffer_sequence_end(bs_);
|
||||
net::buffer_sequence_end(bs_);
|
||||
for(;amount > 0 && begin_ != end; ++begin_)
|
||||
{
|
||||
auto const len =
|
||||
|
||||
@@ -351,7 +351,7 @@ copy_from(DynamicBuffer const& buffer)
|
||||
{
|
||||
if(buffer.size() == 0)
|
||||
return;
|
||||
commit(boost::asio::buffer_copy(
|
||||
commit(net::buffer_copy(
|
||||
prepare(buffer.size()), buffer.data()));
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ flat_static_buffer<N>::
|
||||
flat_static_buffer(flat_static_buffer const& other)
|
||||
: flat_static_buffer_base(buf_, N)
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_copy;
|
||||
this->commit(buffer_copy(
|
||||
this->prepare(other.size()), other.data()));
|
||||
}
|
||||
@@ -101,7 +101,7 @@ flat_static_buffer<N>::
|
||||
operator=(flat_static_buffer const& other) ->
|
||||
flat_static_buffer<N>&
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_copy;
|
||||
this->consume(this->size());
|
||||
this->commit(buffer_copy(
|
||||
this->prepare(other.size()), other.data()));
|
||||
|
||||
@@ -23,9 +23,9 @@ handler_ptr<T, Handler>::
|
||||
clear()
|
||||
{
|
||||
typename beast::detail::allocator_traits<
|
||||
boost::asio::associated_allocator_t<
|
||||
net::associated_allocator_t<
|
||||
Handler>>::template rebind_alloc<T> alloc(
|
||||
boost::asio::get_associated_allocator(
|
||||
net::get_associated_allocator(
|
||||
handler()));
|
||||
beast::detail::allocator_traits<
|
||||
decltype(alloc)>::destroy(alloc, t_);
|
||||
@@ -65,9 +65,9 @@ handler_ptr(DeducedHandler&& h, Args&&... args)
|
||||
{
|
||||
BOOST_STATIC_ASSERT(! std::is_array<T>::value);
|
||||
typename beast::detail::allocator_traits<
|
||||
boost::asio::associated_allocator_t<
|
||||
net::associated_allocator_t<
|
||||
Handler>>::template rebind_alloc<T> alloc{
|
||||
boost::asio::get_associated_allocator(h)};
|
||||
net::get_associated_allocator(h)};
|
||||
using A = decltype(alloc);
|
||||
bool destroy = false;
|
||||
auto deleter = [&alloc, &destroy](T* p)
|
||||
|
||||
@@ -143,8 +143,8 @@ class basic_multi_buffer<Allocator>::readable_bytes
|
||||
public:
|
||||
using value_type = typename std::conditional<
|
||||
IsMutable,
|
||||
boost::asio::mutable_buffer,
|
||||
boost::asio::const_buffer>::type;
|
||||
net::mutable_buffer,
|
||||
net::const_buffer>::type;
|
||||
|
||||
class const_iterator;
|
||||
|
||||
@@ -881,7 +881,7 @@ copy_from(DynamicBuffer const& buffer)
|
||||
{
|
||||
if(buffer.size() == 0)
|
||||
return;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_copy;
|
||||
commit(buffer_copy(
|
||||
prepare(buffer.size()), buffer.data()));
|
||||
}
|
||||
@@ -1018,7 +1018,7 @@ basic_multi_buffer<Allocator>::
|
||||
debug_check() const
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
BOOST_ASSERT(buffer_size(data()) == in_size_);
|
||||
if(list_.empty())
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ read_size(DynamicBuffer& buffer,
|
||||
std::size_t max_size, std::false_type)
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(max_size >= 1);
|
||||
auto const size = buffer.size();
|
||||
|
||||
@@ -35,7 +35,7 @@ static_buffer_base::
|
||||
data() const noexcept ->
|
||||
const_buffers_type
|
||||
{
|
||||
using boost::asio::const_buffer;
|
||||
using net::const_buffer;
|
||||
const_buffers_type result;
|
||||
if(in_off_ + in_size_ <= capacity_)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ static_buffer_base::
|
||||
data() noexcept ->
|
||||
mutable_data_type
|
||||
{
|
||||
using boost::asio::mutable_buffer;
|
||||
using net::mutable_buffer;
|
||||
mutable_data_type result;
|
||||
if(in_off_ + in_size_ <= capacity_)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ static_buffer_base::
|
||||
prepare(std::size_t n) ->
|
||||
mutable_buffers_type
|
||||
{
|
||||
using boost::asio::mutable_buffer;
|
||||
using net::mutable_buffer;
|
||||
if(n > capacity_ - in_size_)
|
||||
BOOST_THROW_EXCEPTION(std::length_error{
|
||||
"buffer overflow"});
|
||||
@@ -145,7 +145,7 @@ static_buffer<N>::
|
||||
static_buffer(static_buffer const& other)
|
||||
: static_buffer_base(buf_, N)
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_copy;
|
||||
this->commit(buffer_copy(
|
||||
this->prepare(other.size()), other.data()));
|
||||
}
|
||||
@@ -156,7 +156,7 @@ static_buffer<N>::
|
||||
operator=(static_buffer const& other) ->
|
||||
static_buffer<N>&
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_copy;
|
||||
this->consume(this->size());
|
||||
this->commit(buffer_copy(
|
||||
this->prepare(other.size()), other.data()));
|
||||
|
||||
@@ -86,8 +86,8 @@ class basic_multi_buffer
|
||||
using const_iter = typename list_type::const_iterator;
|
||||
|
||||
using size_type = typename alloc_traits::size_type;
|
||||
using const_buffer = boost::asio::const_buffer;
|
||||
using mutable_buffer = boost::asio::mutable_buffer;
|
||||
using const_buffer = net::const_buffer;
|
||||
using mutable_buffer = net::mutable_buffer;
|
||||
|
||||
static_assert(std::is_base_of<std::bidirectional_iterator_tag,
|
||||
typename std::iterator_traits<iter>::iterator_category>::value,
|
||||
|
||||
@@ -49,7 +49,7 @@ detail::buffers_helper<ConstBufferSequence>
|
||||
#endif
|
||||
buffers(ConstBufferSequence const& b)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
return detail::buffers_helper<
|
||||
@@ -91,7 +91,7 @@ detail::ostream_helper<
|
||||
ostream(DynamicBuffer& buffer)
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
return detail::ostream_helper<
|
||||
DynamicBuffer, char, std::char_traits<char>,
|
||||
|
||||
@@ -64,23 +64,23 @@ class static_buffer_base
|
||||
|
||||
class mutable_buffer_pair
|
||||
{
|
||||
boost::asio::mutable_buffer b_[2];
|
||||
net::mutable_buffer b_[2];
|
||||
|
||||
friend class const_buffer_pair;
|
||||
|
||||
public:
|
||||
using const_iterator =
|
||||
boost::asio::mutable_buffer const*;
|
||||
net::mutable_buffer const*;
|
||||
|
||||
// workaround for buffers_iterator bug
|
||||
using value_type =
|
||||
boost::asio::mutable_buffer;
|
||||
net::mutable_buffer;
|
||||
|
||||
mutable_buffer_pair() = default;
|
||||
mutable_buffer_pair(
|
||||
mutable_buffer_pair const&) = default;
|
||||
|
||||
boost::asio::mutable_buffer&
|
||||
net::mutable_buffer&
|
||||
operator[](int i) noexcept
|
||||
{
|
||||
BOOST_ASSERT(i >= 0 && i < 2);
|
||||
@@ -105,15 +105,15 @@ class static_buffer_base
|
||||
|
||||
class const_buffer_pair
|
||||
{
|
||||
boost::asio::const_buffer b_[2];
|
||||
net::const_buffer b_[2];
|
||||
|
||||
public:
|
||||
using const_iterator =
|
||||
boost::asio::const_buffer const*;
|
||||
net::const_buffer const*;
|
||||
|
||||
// workaround for buffers_iterator bug
|
||||
using value_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
const_buffer_pair() = default;
|
||||
const_buffer_pair(
|
||||
@@ -125,7 +125,7 @@ class static_buffer_base
|
||||
{
|
||||
}
|
||||
|
||||
boost::asio::const_buffer&
|
||||
net::const_buffer&
|
||||
operator[](int i) noexcept
|
||||
{
|
||||
BOOST_ASSERT(i >= 0 && i < 2);
|
||||
|
||||
@@ -76,7 +76,7 @@ using is_completion_handler = std::integral_constant<bool,
|
||||
template<class T>
|
||||
void maybe_hello(T& t, std::true_type)
|
||||
{
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
t.get_executor(),
|
||||
[]
|
||||
{
|
||||
@@ -102,7 +102,7 @@ using is_completion_handler = std::integral_constant<bool,
|
||||
@code
|
||||
struct stream
|
||||
{
|
||||
using executor_type = boost::asio::io_context::executor_type;
|
||||
using executor_type = net::io_context::executor_type;
|
||||
executor_type get_executor() noexcept;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ template<class DynamicBuffer>
|
||||
struct basic_dynamic_body
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
|
||||
/** The type of container used for the body
|
||||
@@ -88,8 +88,8 @@ struct basic_dynamic_body
|
||||
put(ConstBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
auto const n = buffer_size(buffers);
|
||||
if(body_.size() > body_.max_size() - n)
|
||||
{
|
||||
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
// The type of buffer sequence returned by `get`.
|
||||
//
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
// Constructor.
|
||||
//
|
||||
@@ -492,11 +492,11 @@ put(ConstBufferSequence const& buffers, error_code& ec)
|
||||
|
||||
// Loop over all the buffers in the sequence,
|
||||
// and write each one to the file.
|
||||
for(auto it = boost::asio::buffer_sequence_begin(buffers);
|
||||
it != boost::asio::buffer_sequence_end(buffers); ++it)
|
||||
for(auto it = net::buffer_sequence_begin(buffers);
|
||||
it != net::buffer_sequence_end(buffers); ++it)
|
||||
{
|
||||
// Write this buffer to the file
|
||||
boost::asio::const_buffer buffer = *it;
|
||||
net::const_buffer buffer = *it;
|
||||
nwritten += body_.file_.write(
|
||||
buffer.data(), buffer.size(), ec);
|
||||
if(ec)
|
||||
|
||||
@@ -526,7 +526,7 @@ public:
|
||||
|
||||
#if ! BOOST_BEAST_DOXYGEN
|
||||
std::size_t
|
||||
put(boost::asio::const_buffer const& buffer,
|
||||
put(net::const_buffer const& buffer,
|
||||
error_code& ec);
|
||||
#endif
|
||||
|
||||
@@ -540,7 +540,7 @@ public:
|
||||
|
||||
This is typically called when a read from the
|
||||
underlying stream object sets the error code to
|
||||
`boost::asio::error::eof`.
|
||||
`net::error::eof`.
|
||||
|
||||
@note Only valid after parsing a complete header.
|
||||
|
||||
|
||||
@@ -121,15 +121,15 @@ struct buffer_body
|
||||
put(ConstBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::buffer_copy;
|
||||
if(! body_.data)
|
||||
{
|
||||
ec = error::need_buffer;
|
||||
return 0;
|
||||
}
|
||||
auto const bytes_transferred =
|
||||
buffer_copy(boost::asio::buffer(
|
||||
buffer_copy(net::buffer(
|
||||
body_.data, body_.size), buffers);
|
||||
body_.data = static_cast<char*>(
|
||||
body_.data) + bytes_transferred;
|
||||
@@ -163,7 +163,7 @@ struct buffer_body
|
||||
|
||||
public:
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace http {
|
||||
stream algorithm as the buffer sequence:
|
||||
@code
|
||||
// writes "\r\n"
|
||||
boost::asio::write(stream, chunk_crlf{});
|
||||
net::write(stream, chunk_crlf{});
|
||||
@endcode
|
||||
|
||||
@see https://tools.ietf.org/html/rfc7230#section-4.1
|
||||
@@ -97,7 +97,7 @@ struct chunk_crlf
|
||||
stream algorithm as the buffer sequence:
|
||||
@code
|
||||
// writes "400;x\r\n"
|
||||
boost::asio::write(stream, chunk_header{1024, "x"});
|
||||
net::write(stream, chunk_header{1024, "x"});
|
||||
@endcode
|
||||
|
||||
@see https://tools.ietf.org/html/rfc7230#section-4.1
|
||||
@@ -106,7 +106,7 @@ class chunk_header
|
||||
{
|
||||
using view_type = buffers_cat_view<
|
||||
detail::chunk_size, // chunk-size
|
||||
boost::asio::const_buffer, // chunk-extensions
|
||||
net::const_buffer, // chunk-extensions
|
||||
chunk_crlf>; // CRLF
|
||||
|
||||
std::shared_ptr<
|
||||
@@ -285,7 +285,7 @@ class chunk_body
|
||||
{
|
||||
using view_type = buffers_cat_view<
|
||||
detail::chunk_size, // chunk-size
|
||||
boost::asio::const_buffer, // chunk-extensions
|
||||
net::const_buffer, // chunk-extensions
|
||||
chunk_crlf, // CRLF
|
||||
ConstBufferSequence, // chunk-body
|
||||
chunk_crlf>; // CRLF
|
||||
@@ -459,7 +459,7 @@ class chunk_last
|
||||
{
|
||||
static_assert(
|
||||
is_fields<Trailer>::value ||
|
||||
boost::asio::is_const_buffer_sequence<Trailer>::value,
|
||||
net::is_const_buffer_sequence<Trailer>::value,
|
||||
"Trailer requirements not met");
|
||||
|
||||
using buffers_type = typename
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace detail {
|
||||
struct chunk_extensions
|
||||
{
|
||||
virtual ~chunk_extensions() = default;
|
||||
virtual boost::asio::const_buffer str() = 0;
|
||||
virtual net::const_buffer str() = 0;
|
||||
};
|
||||
|
||||
template<class ChunkExtensions>
|
||||
@@ -44,7 +44,7 @@ struct chunk_extensions_impl : chunk_extensions
|
||||
{
|
||||
}
|
||||
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
str() override
|
||||
{
|
||||
auto const s = ext_.str();
|
||||
@@ -88,7 +88,7 @@ class chunk_size
|
||||
|
||||
struct sequence
|
||||
{
|
||||
boost::asio::const_buffer b;
|
||||
net::const_buffer b;
|
||||
char data[1 + 2 * sizeof(std::size_t)];
|
||||
|
||||
explicit
|
||||
@@ -104,7 +104,7 @@ class chunk_size
|
||||
std::shared_ptr<sequence> sp_;
|
||||
|
||||
public:
|
||||
using value_type = boost::asio::const_buffer;
|
||||
using value_type = net::const_buffer;
|
||||
|
||||
using const_iterator = value_type const*;
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
|
||||
/// Returns a buffer sequence holding a CRLF for chunk encoding
|
||||
inline
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
chunk_crlf()
|
||||
{
|
||||
return {"\r\n", 2};
|
||||
@@ -144,7 +144,7 @@ chunk_crlf()
|
||||
|
||||
/// Returns a buffer sequence holding a final chunk header
|
||||
inline
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
chunk_last()
|
||||
{
|
||||
return {"0\r\n", 3};
|
||||
@@ -163,7 +163,7 @@ struct chunk_crlf_iter_type
|
||||
value_type() = default;
|
||||
|
||||
operator
|
||||
boost::asio::const_buffer() const
|
||||
net::const_buffer() const
|
||||
{
|
||||
return {s, sizeof(s)};
|
||||
}
|
||||
@@ -190,7 +190,7 @@ struct chunk_size0_iter_type
|
||||
value_type() = default;
|
||||
|
||||
operator
|
||||
boost::asio::const_buffer() const
|
||||
net::const_buffer() const
|
||||
{
|
||||
return {s, sizeof(s)};
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ struct empty_body
|
||||
struct writer
|
||||
{
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
|
||||
@@ -23,7 +23,7 @@ enum class error
|
||||
/** The end of the stream was reached.
|
||||
|
||||
This error is returned when attempting to read HTTP data,
|
||||
and the stream returns the error `boost::asio::error::eof`
|
||||
and the stream returns the error `net::error::eof`
|
||||
before any octets corresponding to a new HTTP message have
|
||||
been received.
|
||||
*/
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
char*
|
||||
data() const;
|
||||
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
buffer() const;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -91,13 +91,13 @@ basic_parser<isRequest, Derived>::
|
||||
put(ConstBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
auto const p = boost::asio::buffer_sequence_begin(buffers);
|
||||
auto const last = boost::asio::buffer_sequence_end(buffers);
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
auto const p = net::buffer_sequence_begin(buffers);
|
||||
auto const last = net::buffer_sequence_end(buffers);
|
||||
if(p == last)
|
||||
{
|
||||
ec.assign(0, ec.category());
|
||||
@@ -106,7 +106,7 @@ put(ConstBufferSequence const& buffers,
|
||||
if(std::next(p) == last)
|
||||
{
|
||||
// single buffer
|
||||
return put(boost::asio::const_buffer(*p), ec);
|
||||
return put(net::const_buffer(*p), ec);
|
||||
}
|
||||
auto const size = buffer_size(buffers);
|
||||
if(size <= max_stack_buffer)
|
||||
@@ -118,20 +118,20 @@ put(ConstBufferSequence const& buffers,
|
||||
buf_len_ = size;
|
||||
}
|
||||
// flatten
|
||||
buffer_copy(boost::asio::buffer(
|
||||
buffer_copy(net::buffer(
|
||||
buf_.get(), buf_len_), buffers);
|
||||
return put(boost::asio::const_buffer{
|
||||
return put(net::const_buffer{
|
||||
buf_.get(), buf_len_}, ec);
|
||||
}
|
||||
|
||||
template<bool isRequest, class Derived>
|
||||
std::size_t
|
||||
basic_parser<isRequest, Derived>::
|
||||
put(boost::asio::const_buffer const& buffer,
|
||||
put(net::const_buffer const& buffer,
|
||||
error_code& ec)
|
||||
{
|
||||
BOOST_ASSERT(state_ != state::complete);
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
auto p = static_cast<char const*>(buffer.data());
|
||||
auto n = buffer.size();
|
||||
auto const p0 = p;
|
||||
@@ -304,10 +304,10 @@ put_from_stack(std::size_t size,
|
||||
error_code& ec)
|
||||
{
|
||||
char buf[max_stack_buffer];
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
buffer_copy(buffer(buf, sizeof(buf)), buffers);
|
||||
return put(boost::asio::const_buffer{
|
||||
return put(net::const_buffer{
|
||||
buf, size}, ec);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ chunk_header::
|
||||
chunk_header(std::size_t size)
|
||||
: view_(
|
||||
size,
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{})
|
||||
{
|
||||
BOOST_ASSERT(size > 0);
|
||||
@@ -37,7 +37,7 @@ chunk_header(
|
||||
string_view extensions)
|
||||
: view_(
|
||||
size,
|
||||
boost::asio::const_buffer{
|
||||
net::const_buffer{
|
||||
extensions.data(), extensions.size()},
|
||||
chunk_crlf{})
|
||||
{
|
||||
@@ -89,8 +89,8 @@ template<class ConstBufferSequence>
|
||||
chunk_body<ConstBufferSequence>::
|
||||
chunk_body(ConstBufferSequence const& buffers)
|
||||
: view_(
|
||||
boost::asio::buffer_size(buffers),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::buffer_size(buffers),
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{},
|
||||
buffers,
|
||||
chunk_crlf{})
|
||||
@@ -103,8 +103,8 @@ chunk_body(
|
||||
ConstBufferSequence const& buffers,
|
||||
string_view extensions)
|
||||
: view_(
|
||||
boost::asio::buffer_size(buffers),
|
||||
boost::asio::const_buffer{
|
||||
net::buffer_size(buffers),
|
||||
net::const_buffer{
|
||||
extensions.data(), extensions.size()},
|
||||
chunk_crlf{},
|
||||
buffers,
|
||||
@@ -122,7 +122,7 @@ chunk_body(
|
||||
typename std::decay<ChunkExtensions>::type>>(
|
||||
std::forward<ChunkExtensions>(extensions)))
|
||||
, view_(
|
||||
boost::asio::buffer_size(buffers),
|
||||
net::buffer_size(buffers),
|
||||
exts_->str(),
|
||||
chunk_crlf{},
|
||||
buffers,
|
||||
@@ -141,7 +141,7 @@ chunk_body(
|
||||
typename std::decay<ChunkExtensions>::type>>(allocator,
|
||||
std::forward<ChunkExtensions>(extensions)))
|
||||
, view_(
|
||||
boost::asio::buffer_size(buffers),
|
||||
net::buffer_size(buffers),
|
||||
exts_->str(),
|
||||
chunk_crlf{},
|
||||
buffers,
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
{
|
||||
iter_type it_;
|
||||
|
||||
using value_type = boost::asio::const_buffer;
|
||||
using value_type = net::const_buffer;
|
||||
using pointer = value_type const*;
|
||||
using reference = value_type const;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -144,9 +144,9 @@ public:
|
||||
};
|
||||
|
||||
using view_type = buffers_cat_view<
|
||||
boost::asio::const_buffer,
|
||||
boost::asio::const_buffer,
|
||||
boost::asio::const_buffer,
|
||||
net::const_buffer,
|
||||
net::const_buffer,
|
||||
net::const_buffer,
|
||||
field_range,
|
||||
chunk_crlf>;
|
||||
|
||||
@@ -179,9 +179,9 @@ writer(basic_fields const& f)
|
||||
: f_(f)
|
||||
{
|
||||
view_.emplace(
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
field_range(f_.list_.begin(), f_.list_.end()),
|
||||
chunk_crlf());
|
||||
}
|
||||
@@ -219,11 +219,11 @@ writer(basic_fields const& f,
|
||||
buf_[10]= '\n';
|
||||
|
||||
view_.emplace(
|
||||
boost::asio::const_buffer{sv.data(), sv.size()},
|
||||
boost::asio::const_buffer{
|
||||
net::const_buffer{sv.data(), sv.size()},
|
||||
net::const_buffer{
|
||||
f_.target_or_reason_.data(),
|
||||
f_.target_or_reason_.size()},
|
||||
boost::asio::const_buffer{buf_, 11},
|
||||
net::const_buffer{buf_, 11},
|
||||
field_range(f_.list_.begin(), f_.list_.end()),
|
||||
chunk_crlf());
|
||||
}
|
||||
@@ -261,9 +261,9 @@ writer(basic_fields const& f,
|
||||
sv = obsolete_reason(static_cast<status>(code));
|
||||
|
||||
view_.emplace(
|
||||
boost::asio::const_buffer{buf_, 13},
|
||||
boost::asio::const_buffer{sv.data(), sv.size()},
|
||||
boost::asio::const_buffer{"\r\n", 2},
|
||||
net::const_buffer{buf_, 13},
|
||||
net::const_buffer{sv.data(), sv.size()},
|
||||
net::const_buffer{"\r\n", 2},
|
||||
field_range(f_.list_.begin(), f_.list_.end()),
|
||||
chunk_crlf{});
|
||||
}
|
||||
@@ -282,12 +282,12 @@ data() const
|
||||
}
|
||||
|
||||
template<class Allocator>
|
||||
boost::asio::const_buffer
|
||||
net::const_buffer
|
||||
basic_fields<Allocator>::
|
||||
value_type::
|
||||
buffer() const
|
||||
{
|
||||
return boost::asio::const_buffer{data(),
|
||||
return net::const_buffer{data(),
|
||||
static_cast<std::size_t>(off_) + len_ + 2};
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ struct basic_file_body<file_win32>
|
||||
friend
|
||||
std::size_t
|
||||
write_some(
|
||||
boost::asio::basic_stream_socket<Protocol>& sock,
|
||||
net::basic_stream_socket<Protocol>& sock,
|
||||
serializer<isRequest,
|
||||
basic_file_body<file_win32>, Fields>& sr,
|
||||
error_code& ec);
|
||||
@@ -113,7 +113,7 @@ struct basic_file_body<file_win32>
|
||||
friend
|
||||
std::size_t
|
||||
write_some(
|
||||
boost::asio::basic_stream_socket<Protocol>& sock,
|
||||
net::basic_stream_socket<Protocol>& sock,
|
||||
serializer<isRequest,
|
||||
basic_file_body<file_win32>, Fields>& sr,
|
||||
error_code& ec);
|
||||
@@ -124,7 +124,7 @@ struct basic_file_body<file_win32>
|
||||
|
||||
public:
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
writer(header<isRequest, Fields>&, value_type& b)
|
||||
@@ -338,9 +338,9 @@ template<
|
||||
bool isRequest, class Fields>
|
||||
class write_some_win32_op
|
||||
{
|
||||
boost::asio::basic_stream_socket<Protocol>& sock_;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
boost::asio::basic_stream_socket<Protocol>&>().get_executor())> wg_;
|
||||
net::basic_stream_socket<Protocol>& sock_;
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
net::basic_stream_socket<Protocol>&>().get_executor())> wg_;
|
||||
serializer<isRequest,
|
||||
basic_file_body<file_win32>, Fields>& sr_;
|
||||
std::size_t bytes_transferred_ = 0;
|
||||
@@ -354,7 +354,7 @@ public:
|
||||
template<class DeducedHandler>
|
||||
write_some_win32_op(
|
||||
DeducedHandler&& h,
|
||||
boost::asio::basic_stream_socket<Protocol>& s,
|
||||
net::basic_stream_socket<Protocol>& s,
|
||||
serializer<isRequest,
|
||||
basic_file_body<file_win32>,Fields>& sr)
|
||||
: sock_(s)
|
||||
@@ -365,22 +365,22 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type =
|
||||
boost::asio::associated_executor_t<Handler, decltype(std::declval<
|
||||
boost::asio::basic_stream_socket<Protocol>&>().get_executor())>;
|
||||
net::associated_executor_t<Handler, decltype(std::declval<
|
||||
net::basic_stream_socket<Protocol>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, sock_.get_executor());
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(write_some_win32_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -404,7 +404,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, write_some_win32_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -435,7 +435,7 @@ operator()()
|
||||
(std::min<std::uint64_t>)(
|
||||
(std::min<std::uint64_t>)(w.body_.last_ - w.pos_, sr_.limit()),
|
||||
(std::numeric_limits<boost::winapi::DWORD_>::max)()));
|
||||
boost::asio::windows::overlapped_ptr overlapped{
|
||||
net::windows::overlapped_ptr overlapped{
|
||||
sock_.get_executor().context(), std::move(*this)};
|
||||
// Note that we have moved *this, so we cannot access
|
||||
// the handler since it is now moved-from. We can still
|
||||
@@ -503,7 +503,7 @@ operator()(
|
||||
template<class Protocol, bool isRequest, class Fields>
|
||||
std::size_t
|
||||
write_some(
|
||||
boost::asio::basic_stream_socket<Protocol>& sock,
|
||||
net::basic_stream_socket<Protocol>& sock,
|
||||
serializer<isRequest,
|
||||
basic_file_body<file_win32>, Fields>& sr,
|
||||
error_code& ec)
|
||||
@@ -573,7 +573,7 @@ template<
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
WriteHandler, void(error_code, std::size_t))
|
||||
async_write_some(
|
||||
boost::asio::basic_stream_socket<Protocol>& sock,
|
||||
net::basic_stream_socket<Protocol>& sock,
|
||||
serializer<isRequest,
|
||||
basic_file_body<file_win32>, Fields>& sr,
|
||||
WriteHandler&& handler)
|
||||
|
||||
@@ -43,10 +43,10 @@ namespace detail {
|
||||
template<class Stream, class DynamicBuffer,
|
||||
bool isRequest, class Derived, class Handler>
|
||||
class read_some_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
Stream& s_;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg_;
|
||||
DynamicBuffer& b_;
|
||||
basic_parser<isRequest, Derived>& p_;
|
||||
@@ -70,21 +70,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<Stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(read_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return op->cont_ ? true :
|
||||
asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -155,7 +155,7 @@ operator()(
|
||||
goto upcall;
|
||||
s_.async_read_some(*mb, std::move(*this));
|
||||
}
|
||||
if(ec == boost::asio::error::eof)
|
||||
if(ec == net::error::eof)
|
||||
{
|
||||
BOOST_ASSERT(bytes_transferred == 0);
|
||||
if(p_.got_some())
|
||||
@@ -180,7 +180,7 @@ operator()(
|
||||
if(! cont_)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
s_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this),
|
||||
ec, bytes_transferred_));
|
||||
@@ -217,10 +217,10 @@ template<class Stream, class DynamicBuffer,
|
||||
bool isRequest, class Derived, class Condition,
|
||||
class Handler>
|
||||
class read_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
Stream& s_;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg_;
|
||||
DynamicBuffer& b_;
|
||||
basic_parser<isRequest, Derived>& p_;
|
||||
@@ -245,21 +245,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<Stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(read_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return op->cont_ ? true :
|
||||
asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -304,7 +304,7 @@ operator()(
|
||||
if(Condition{}(p_))
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(s_.get_executor(),
|
||||
net::post(s_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec));
|
||||
goto upcall;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ template<class Stream, class DynamicBuffer,
|
||||
bool isRequest, class Body, class Allocator,
|
||||
class Handler>
|
||||
class read_msg_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
using parser_type =
|
||||
parser<isRequest, Body, Allocator>;
|
||||
@@ -341,7 +341,7 @@ class read_msg_op
|
||||
struct data
|
||||
{
|
||||
Stream& s;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg;
|
||||
DynamicBuffer& b;
|
||||
message_type& m;
|
||||
@@ -375,21 +375,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<Stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->s.get_executor());
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(read_msg_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return op->d_->cont ? true :
|
||||
asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_msg_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->d_.handler()));
|
||||
}
|
||||
};
|
||||
@@ -473,7 +473,7 @@ read_some(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(! parser.is_done());
|
||||
error_code ec;
|
||||
@@ -498,7 +498,7 @@ read_some(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(! parser.is_done());
|
||||
std::size_t bytes_transferred = 0;
|
||||
@@ -529,7 +529,7 @@ read_some(
|
||||
if(ec)
|
||||
break;
|
||||
auto const n = stream.read_some(*mb, ec);
|
||||
if(ec == boost::asio::error::eof)
|
||||
if(ec == net::error::eof)
|
||||
{
|
||||
BOOST_ASSERT(n == 0);
|
||||
if(parser.got_some())
|
||||
@@ -567,7 +567,7 @@ async_read_some(
|
||||
static_assert(is_async_read_stream<AsyncReadStream>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_ASSERT(! parser.is_done());
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -595,7 +595,7 @@ read_header(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
auto const bytes_transferred =
|
||||
@@ -619,7 +619,7 @@ read_header(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
parser.eager(false);
|
||||
if(parser.is_header_done())
|
||||
@@ -655,7 +655,7 @@ async_read_header(
|
||||
static_assert(is_async_read_stream<AsyncReadStream>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
parser.eager(false);
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -683,7 +683,7 @@ read(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
auto const bytes_transferred =
|
||||
@@ -707,7 +707,7 @@ read(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
parser.eager(true);
|
||||
if(parser.is_done())
|
||||
@@ -743,7 +743,7 @@ async_read(
|
||||
static_assert(is_async_read_stream<AsyncReadStream>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
parser.eager(true);
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -771,7 +771,7 @@ read(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
static_assert(is_body<Body>::value,
|
||||
"Body requirements not met");
|
||||
@@ -799,7 +799,7 @@ read(
|
||||
static_assert(is_sync_read_stream<SyncReadStream>::value,
|
||||
"SyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
static_assert(is_body<Body>::value,
|
||||
"Body requirements not met");
|
||||
@@ -831,7 +831,7 @@ async_read(
|
||||
static_assert(is_async_read_stream<AsyncReadStream>::value,
|
||||
"AsyncReadStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
static_assert(is_body<Body>::value,
|
||||
"Body requirements not met");
|
||||
|
||||
@@ -70,7 +70,7 @@ void
|
||||
serializer<isRequest, Body, Fields>::
|
||||
next(error_code& ec, Visit&& visit)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
switch(s_)
|
||||
{
|
||||
case do_construct:
|
||||
@@ -166,12 +166,12 @@ next(error_code& ec, Visit&& visit)
|
||||
boost::in_place_init,
|
||||
fwr_->get(),
|
||||
buffer_size(result->first),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{},
|
||||
result->first,
|
||||
chunk_crlf{},
|
||||
detail::chunk_last(),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{});
|
||||
goto go_all_c;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ next(error_code& ec, Visit&& visit)
|
||||
boost::in_place_init,
|
||||
fwr_->get(),
|
||||
buffer_size(result->first),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{},
|
||||
result->first,
|
||||
chunk_crlf{});
|
||||
@@ -218,19 +218,19 @@ next(error_code& ec, Visit&& visit)
|
||||
v_.template emplace<6>(
|
||||
boost::in_place_init,
|
||||
buffer_size(result->first),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{},
|
||||
result->first,
|
||||
chunk_crlf{},
|
||||
detail::chunk_last(),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{});
|
||||
goto go_body_final_c;
|
||||
}
|
||||
v_.template emplace<5>(
|
||||
boost::in_place_init,
|
||||
buffer_size(result->first),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{},
|
||||
result->first,
|
||||
chunk_crlf{});
|
||||
@@ -261,7 +261,7 @@ next(error_code& ec, Visit&& visit)
|
||||
v_.template emplace<8>(
|
||||
boost::in_place_init,
|
||||
detail::chunk_last(),
|
||||
boost::asio::const_buffer{nullptr, 0},
|
||||
net::const_buffer{nullptr, 0},
|
||||
chunk_crlf{});
|
||||
s_ = do_final_c + 1;
|
||||
BOOST_FALLTHROUGH;
|
||||
@@ -289,7 +289,7 @@ void
|
||||
serializer<isRequest, Body, Fields>::
|
||||
consume(std::size_t n)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_size;
|
||||
switch(s_)
|
||||
{
|
||||
case do_header:
|
||||
|
||||
@@ -41,7 +41,7 @@ template<
|
||||
class write_some_op
|
||||
{
|
||||
Stream& s_;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg_;
|
||||
serializer<isRequest,Body, Fields>& sr_;
|
||||
Handler h_;
|
||||
@@ -86,21 +86,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<Stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(write_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, write_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -145,7 +145,7 @@ operator()()
|
||||
if(ec)
|
||||
{
|
||||
BOOST_ASSERT(! f.invoked);
|
||||
return boost::asio::post(
|
||||
return net::post(
|
||||
s_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec, 0));
|
||||
}
|
||||
@@ -158,7 +158,7 @@ operator()()
|
||||
// What else could it be?
|
||||
BOOST_ASSERT(sr_.is_done());
|
||||
}
|
||||
return boost::asio::post(
|
||||
return net::post(
|
||||
s_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec, 0));
|
||||
}
|
||||
@@ -208,10 +208,10 @@ struct serializer_is_done
|
||||
template<
|
||||
class Stream, class Handler, class Predicate,
|
||||
bool isRequest, class Body, class Fields>
|
||||
class write_op : public boost::asio::coroutine
|
||||
class write_op : public net::coroutine
|
||||
{
|
||||
Stream& s_;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg_;
|
||||
serializer<isRequest, Body, Fields>& sr_;
|
||||
std::size_t bytes_transferred_ = 0;
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
, h_(std::forward<DeducedHandler>(h))
|
||||
, cont_([&]
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(h_));
|
||||
}())
|
||||
@@ -239,21 +239,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<Stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, write_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -292,7 +292,7 @@ operator()(
|
||||
if(Predicate{}(sr_))
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
s_.get_executor(),
|
||||
std::move(*this));
|
||||
goto upcall;
|
||||
@@ -323,7 +323,7 @@ class write_msg_op
|
||||
struct data
|
||||
{
|
||||
Stream& s;
|
||||
boost::asio::executor_work_guard<decltype(
|
||||
net::executor_work_guard<decltype(
|
||||
std::declval<Stream&>().get_executor())> wg;
|
||||
serializer<isRequest, Body, Fields> sr;
|
||||
|
||||
@@ -358,21 +358,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<Stream&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->s.get_executor());
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(write_msg_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, write_msg_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->d_.handler()));
|
||||
}
|
||||
};
|
||||
@@ -471,7 +471,7 @@ public:
|
||||
ConstBufferSequence const& buffers)
|
||||
{
|
||||
invoked = true;
|
||||
bytes_transferred = boost::asio::write(
|
||||
bytes_transferred = net::write(
|
||||
stream_, buffers, ec);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -414,7 +414,7 @@ private:
|
||||
string_view body,
|
||||
error_code& ec)
|
||||
{
|
||||
return rd_.put(boost::asio::buffer(
|
||||
return rd_.put(net::buffer(
|
||||
body.data(), body.size()), ec);
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ private:
|
||||
{
|
||||
if(cb_b_)
|
||||
return cb_b_(remain, body, ec);
|
||||
return rd_.put(boost::asio::buffer(
|
||||
return rd_.put(net::buffer(
|
||||
body.data(), body.size()), ec);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace http {
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -90,7 +90,7 @@ read_some(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -151,7 +151,7 @@ read_some(
|
||||
end of the object being parsed. This additional data is stored
|
||||
in the stream buffer, which may be used in subsequent calls.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -185,7 +185,7 @@ read_some(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
The completion handler will receive as a parameter the number
|
||||
of octets processed from the dynamic buffer. The octets should
|
||||
@@ -223,7 +223,7 @@ async_read_some(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -278,7 +278,7 @@ read_header(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -337,7 +337,7 @@ read_header(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -371,7 +371,7 @@ read_header(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@note The implementation will call @ref basic_parser::eager
|
||||
with the value `false` on the parser passed in.
|
||||
@@ -407,7 +407,7 @@ async_read_header(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -462,7 +462,7 @@ read(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -521,7 +521,7 @@ read(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -555,7 +555,7 @@ read(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@note The implementation will call @ref basic_parser::eager
|
||||
with the value `true` on the parser passed in.
|
||||
@@ -590,7 +590,7 @@ async_read(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -644,7 +644,7 @@ read(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -703,7 +703,7 @@ read(
|
||||
end of the message being read. This additional data is stored
|
||||
in the dynamic buffer, which must be retained for subsequent reads.
|
||||
|
||||
If the stream returns the error `boost::asio::error::eof` indicating the
|
||||
If the stream returns the error `net::error::eof` indicating the
|
||||
end of file during a read, the error returned from this function will be:
|
||||
|
||||
@li @ref error::end_of_stream if no octets were parsed, or
|
||||
@@ -741,7 +741,7 @@ read(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class AsyncReadStream,
|
||||
|
||||
@@ -130,7 +130,7 @@ private:
|
||||
using cb4_t = buffers_suffix<buffers_cat_view<
|
||||
typename Fields::writer::const_buffers_type,// header
|
||||
detail::chunk_size, // chunk-size
|
||||
boost::asio::const_buffer, // chunk-ext
|
||||
net::const_buffer, // chunk-ext
|
||||
chunk_crlf, // crlf
|
||||
typename writer::const_buffers_type, // body
|
||||
chunk_crlf>>; // crlf
|
||||
@@ -138,7 +138,7 @@ private:
|
||||
|
||||
using cb5_t = buffers_suffix<buffers_cat_view<
|
||||
detail::chunk_size, // chunk-header
|
||||
boost::asio::const_buffer, // chunk-ext
|
||||
net::const_buffer, // chunk-ext
|
||||
chunk_crlf, // crlf
|
||||
typename writer::const_buffers_type, // body
|
||||
chunk_crlf>>; // crlf
|
||||
@@ -146,30 +146,30 @@ private:
|
||||
|
||||
using cb6_t = buffers_suffix<buffers_cat_view<
|
||||
detail::chunk_size, // chunk-header
|
||||
boost::asio::const_buffer, // chunk-size
|
||||
net::const_buffer, // chunk-size
|
||||
chunk_crlf, // crlf
|
||||
typename writer::const_buffers_type, // body
|
||||
chunk_crlf, // crlf
|
||||
boost::asio::const_buffer, // chunk-final
|
||||
boost::asio::const_buffer, // trailers
|
||||
net::const_buffer, // chunk-final
|
||||
net::const_buffer, // trailers
|
||||
chunk_crlf>>; // crlf
|
||||
using pcb6_t = buffers_prefix_view<cb6_t const&>;
|
||||
|
||||
using cb7_t = buffers_suffix<buffers_cat_view<
|
||||
typename Fields::writer::const_buffers_type,// header
|
||||
detail::chunk_size, // chunk-size
|
||||
boost::asio::const_buffer, // chunk-ext
|
||||
net::const_buffer, // chunk-ext
|
||||
chunk_crlf, // crlf
|
||||
typename writer::const_buffers_type, // body
|
||||
chunk_crlf, // crlf
|
||||
boost::asio::const_buffer, // chunk-final
|
||||
boost::asio::const_buffer, // trailers
|
||||
net::const_buffer, // chunk-final
|
||||
net::const_buffer, // trailers
|
||||
chunk_crlf>>; // crlf
|
||||
using pcb7_t = buffers_prefix_view<cb7_t const&>;
|
||||
|
||||
using cb8_t = buffers_suffix<buffers_cat_view<
|
||||
boost::asio::const_buffer, // chunk-final
|
||||
boost::asio::const_buffer, // trailers
|
||||
net::const_buffer, // chunk-final
|
||||
net::const_buffer, // trailers
|
||||
chunk_crlf>>; // crlf
|
||||
using pcb8_t = buffers_prefix_view<cb8_t const&>;
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ public:
|
||||
put(ConstBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::buffer_copy;
|
||||
auto const n = buffer_size(buffers);
|
||||
auto const len = body_.size();
|
||||
if(n > len)
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
ec.assign(0, ec.category());
|
||||
buffer_copy(boost::asio::buffer(
|
||||
buffer_copy(net::buffer(
|
||||
body_.data(), n), buffers);
|
||||
body_ = value_type{
|
||||
body_.data() + n, body_.size() - n};
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
|
||||
public:
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
|
||||
@@ -117,8 +117,8 @@ public:
|
||||
put(ConstBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::buffer_copy;
|
||||
auto const extra = buffer_size(buffers);
|
||||
auto const size = body_.size();
|
||||
try
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
public:
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
|
||||
@@ -88,7 +88,7 @@ struct is_body_writer<T, beast::detail::void_t<
|
||||
typename T::writer::const_buffers_type, bool>>&>() =
|
||||
std::declval<typename T::writer>().get(std::declval<error_code&>())
|
||||
)>> : std::integral_constant<bool,
|
||||
boost::asio::is_const_buffer_sequence<
|
||||
net::is_const_buffer_sequence<
|
||||
typename T::writer::const_buffers_type>::value && (
|
||||
(std::is_constructible<typename T::writer,
|
||||
header<true, detail::fields_model>&,
|
||||
@@ -119,7 +119,7 @@ struct is_mutable_body_writer<T, beast::detail::void_t<
|
||||
typename T::writer::const_buffers_type, bool>>&>() =
|
||||
std::declval<typename T::writer>().get(std::declval<error_code&>())
|
||||
)>> : std::integral_constant<bool,
|
||||
boost::asio::is_const_buffer_sequence<
|
||||
net::is_const_buffer_sequence<
|
||||
typename T::writer::const_buffers_type>::value && ((
|
||||
std::is_constructible<typename T::writer,
|
||||
header<true, detail::fields_model>&,
|
||||
@@ -171,7 +171,7 @@ struct is_body_reader<T, beast::detail::void_t<decltype(
|
||||
std::declval<error_code&>()),
|
||||
std::declval<std::size_t&>() =
|
||||
std::declval<typename T::reader&>().put(
|
||||
std::declval<boost::asio::const_buffer>(),
|
||||
std::declval<net::const_buffer>(),
|
||||
std::declval<error_code&>()),
|
||||
std::declval<typename T::reader&>().finish(
|
||||
std::declval<error_code&>())
|
||||
|
||||
@@ -111,8 +111,8 @@ public:
|
||||
put(ConstBufferSequence const& buffers,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::buffer_copy;
|
||||
auto const n = buffer_size(buffers);
|
||||
auto const len = body_.size();
|
||||
try
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
ec.assign(0, ec.category());
|
||||
return buffer_copy(boost::asio::buffer(
|
||||
return buffer_copy(net::buffer(
|
||||
&body_[0] + len, n), buffers);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
|
||||
public:
|
||||
using const_buffers_type =
|
||||
boost::asio::const_buffer;
|
||||
net::const_buffer;
|
||||
|
||||
template<bool isRequest, class Fields>
|
||||
explicit
|
||||
|
||||
@@ -159,7 +159,7 @@ write_some(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@see @ref serializer
|
||||
*/
|
||||
@@ -280,7 +280,7 @@ write_header(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@note The implementation will call @ref serializer::split with
|
||||
the value `true` on the serializer passed in.
|
||||
@@ -398,7 +398,7 @@ write(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@see @ref serializer
|
||||
*/
|
||||
@@ -617,7 +617,7 @@ write(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@see @ref message
|
||||
*/
|
||||
@@ -675,7 +675,7 @@ async_write(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
|
||||
@see @ref message
|
||||
*/
|
||||
|
||||
@@ -184,8 +184,8 @@ template<class DynamicBuffer>
|
||||
void
|
||||
write(DynamicBuffer& db, frame_header const& fh)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
using namespace boost::endian;
|
||||
std::size_t n;
|
||||
std::uint8_t b[14];
|
||||
@@ -231,9 +231,9 @@ template<class Buffers>
|
||||
void
|
||||
read_ping(ping_data& data, Buffers const& bs)
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::mutable_buffer;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::mutable_buffer;
|
||||
BOOST_ASSERT(buffer_size(bs) <= data.max_size());
|
||||
data.resize(buffer_size(bs));
|
||||
buffer_copy(mutable_buffer{
|
||||
@@ -250,9 +250,9 @@ read_close(
|
||||
Buffers const& bs,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using namespace boost::endian;
|
||||
auto n = buffer_size(bs);
|
||||
BOOST_ASSERT(n <= 125);
|
||||
|
||||
@@ -49,7 +49,7 @@ rol(std::array<unsigned char, N>& v, std::size_t n)
|
||||
//
|
||||
inline
|
||||
void
|
||||
mask_inplace(boost::asio::mutable_buffer& b, prepared_key& key)
|
||||
mask_inplace(net::mutable_buffer& b, prepared_key& key)
|
||||
{
|
||||
auto n = b.size();
|
||||
auto mask = key; // avoid aliasing
|
||||
@@ -75,7 +75,7 @@ template<class MutableBuffers, class KeyType>
|
||||
void
|
||||
mask_inplace(MutableBuffers const& bs, KeyType& key)
|
||||
{
|
||||
for(boost::asio::mutable_buffer b :
|
||||
for(net::mutable_buffer b :
|
||||
beast::buffers_range(std::ref(bs)))
|
||||
mask_inplace(b, key);
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ class pausation
|
||||
{
|
||||
Handler h(std::move(h_));
|
||||
typename beast::detail::allocator_traits<
|
||||
boost::asio::associated_allocator_t<
|
||||
net::associated_allocator_t<
|
||||
Handler>>::template rebind_alloc<impl> alloc{
|
||||
boost::asio::get_associated_allocator(h)};
|
||||
net::get_associated_allocator(h)};
|
||||
beast::detail::allocator_traits<
|
||||
decltype(alloc)>::destroy(alloc, this);
|
||||
beast::detail::allocator_traits<
|
||||
@@ -68,9 +68,9 @@ class pausation
|
||||
{
|
||||
Handler h(std::move(h_));
|
||||
typename beast::detail::allocator_traits<
|
||||
boost::asio::associated_allocator_t<
|
||||
net::associated_allocator_t<
|
||||
Handler>>::template rebind_alloc<impl> alloc{
|
||||
boost::asio::get_associated_allocator(h)};
|
||||
net::get_associated_allocator(h)};
|
||||
beast::detail::allocator_traits<
|
||||
decltype(alloc)>::destroy(alloc, this);
|
||||
beast::detail::allocator_traits<
|
||||
@@ -137,10 +137,10 @@ pausation::emplace(CompletionHandler&& handler)
|
||||
{
|
||||
BOOST_ASSERT(! h_);
|
||||
typename beast::detail::allocator_traits<
|
||||
boost::asio::associated_allocator_t<
|
||||
net::associated_allocator_t<
|
||||
CompletionHandler>>::template rebind_alloc<
|
||||
impl<CompletionHandler>> alloc{
|
||||
boost::asio::get_associated_allocator(handler)};
|
||||
net::get_associated_allocator(handler)};
|
||||
using A = decltype(alloc);
|
||||
auto const d =
|
||||
[&alloc](impl<CompletionHandler>* p)
|
||||
|
||||
@@ -340,7 +340,7 @@ struct stream_base : stream_prng
|
||||
template<class ConstBufferSequence>
|
||||
bool
|
||||
deflate(
|
||||
boost::asio::mutable_buffer& out,
|
||||
net::mutable_buffer& out,
|
||||
buffers_suffix<ConstBufferSequence>& cb,
|
||||
bool fin,
|
||||
std::size_t& total_in,
|
||||
@@ -539,7 +539,7 @@ struct stream_base<false> : stream_prng
|
||||
template<class ConstBufferSequence>
|
||||
bool
|
||||
deflate(
|
||||
boost::asio::mutable_buffer&,
|
||||
net::mutable_buffer&,
|
||||
buffers_suffix<ConstBufferSequence>&,
|
||||
bool,
|
||||
std::size_t&,
|
||||
|
||||
@@ -86,7 +86,7 @@ bool
|
||||
utf8_checker_t<_>::
|
||||
write(ConstBufferSequence const& bs)
|
||||
{
|
||||
static_assert(boost::asio::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
static_assert(net::is_const_buffer_sequence<ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
for(auto b : beast::buffers_range(std::ref(bs)))
|
||||
if(! write(static_cast<
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace websocket {
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
template<class Handler>
|
||||
class stream<NextLayer, deflateSupported>::response_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
struct data
|
||||
{
|
||||
stream<NextLayer, deflateSupported>& ws;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg;
|
||||
error_code result;
|
||||
response_type res;
|
||||
@@ -79,22 +79,22 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->ws.get_executor());
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(response_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, response_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->d_.handler()));
|
||||
}
|
||||
};
|
||||
@@ -156,12 +156,12 @@ operator()(
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
template<class Decorator, class Handler>
|
||||
class stream<NextLayer, deflateSupported>::accept_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
struct data
|
||||
{
|
||||
stream<NextLayer, deflateSupported>& ws;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg;
|
||||
Decorator decorator;
|
||||
http::request_parser<http::empty_body> p;
|
||||
@@ -191,21 +191,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->ws.get_executor());
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(accept_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, accept_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->d_.handler()));
|
||||
}
|
||||
};
|
||||
@@ -241,8 +241,8 @@ stream<NextLayer, deflateSupported>::
|
||||
accept_op<Decorator, Handler>::
|
||||
run(Buffers const& buffers)
|
||||
{
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
auto& d = *d_;
|
||||
error_code ec;
|
||||
auto const mb = beast::detail::dynamic_buffer_prepare(
|
||||
@@ -267,7 +267,7 @@ operator()(error_code ec, std::size_t)
|
||||
if(ec)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
d.ws.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec));
|
||||
}
|
||||
@@ -375,7 +375,7 @@ accept(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -397,7 +397,7 @@ accept_ex(
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_response_decorator<
|
||||
@@ -419,11 +419,11 @@ accept(
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
reset();
|
||||
auto const mb = beast::detail::dynamic_buffer_prepare(
|
||||
rd_buf_, buffer_size(buffers), ec,
|
||||
@@ -448,14 +448,14 @@ accept_ex(
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
reset();
|
||||
auto const mb = beast::detail::dynamic_buffer_prepare(
|
||||
rd_buf_, buffer_size(buffers), ec,
|
||||
@@ -610,7 +610,7 @@ async_accept(
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -643,7 +643,7 @@ async_accept_ex(
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
static_assert(detail::is_response_decorator<
|
||||
@@ -678,7 +678,7 @@ async_accept(
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
AcceptHandler, void(error_code));
|
||||
reset();
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
response_op<
|
||||
BOOST_ASIO_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{
|
||||
@@ -710,7 +710,7 @@ async_accept_ex(
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
AcceptHandler, void(error_code));
|
||||
reset();
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
response_op<
|
||||
BOOST_ASIO_HANDLER_TYPE(
|
||||
AcceptHandler, void(error_code))>{
|
||||
|
||||
@@ -39,12 +39,12 @@ namespace websocket {
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
template<class Handler>
|
||||
class stream<NextLayer, deflateSupported>::close_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
struct state
|
||||
{
|
||||
stream<NextLayer, deflateSupported>& ws;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg;
|
||||
detail::frame_buffer fb;
|
||||
error_code ev;
|
||||
@@ -81,21 +81,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->ws.get_executor());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(close_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return op->d_->cont || asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, close_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f,
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -150,7 +150,7 @@ operator()(
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
d.ws.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
||||
}
|
||||
@@ -169,7 +169,7 @@ operator()(
|
||||
// Send close frame
|
||||
d.ws.wr_close_ = true;
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(d.ws.stream_,
|
||||
net::async_write(d.ws.stream_,
|
||||
d.fb.data(), std::move(*this));
|
||||
if(! d.ws.check_ok(ec))
|
||||
goto upcall;
|
||||
@@ -194,7 +194,7 @@ operator()(
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
d.ws.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(d.ws.rd_block_.is_locked(this));
|
||||
|
||||
@@ -277,7 +277,7 @@ operator()(
|
||||
async_teardown(d.ws.role_,
|
||||
d.ws.stream_, std::move(*this));
|
||||
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
||||
if(ec == boost::asio::error::eof)
|
||||
if(ec == net::error::eof)
|
||||
{
|
||||
// Rationale:
|
||||
// http://stackoverflow.com/questions/25587403/boost-asio-ssl-async-shutdown-always-finishes-with-an-error
|
||||
@@ -302,7 +302,7 @@ operator()(
|
||||
if(! d.cont)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
d.ws.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec));
|
||||
}
|
||||
@@ -347,7 +347,7 @@ close(close_reason const& cr, error_code& ec)
|
||||
{
|
||||
detail::frame_buffer fb;
|
||||
write_close<flat_static_buffer_base>(fb, cr);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
net::write(stream_, fb.data(), ec);
|
||||
}
|
||||
if(! check_ok(ec))
|
||||
return;
|
||||
|
||||
@@ -38,12 +38,12 @@ namespace websocket {
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
template<class Handler>
|
||||
class stream<NextLayer, deflateSupported>::handshake_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
struct data
|
||||
{
|
||||
stream<NextLayer, deflateSupported>& ws;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg;
|
||||
response_type* res_p;
|
||||
detail::sec_ws_key_type key;
|
||||
@@ -83,21 +83,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->ws.get_executor());
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(handshake_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, handshake_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f,
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace websocket {
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
template<class Handler>
|
||||
class stream<NextLayer, deflateSupported>::ping_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
struct state
|
||||
{
|
||||
stream<NextLayer, deflateSupported>& ws;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg;
|
||||
detail::frame_buffer fb;
|
||||
|
||||
@@ -81,21 +81,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(d_.handler());
|
||||
return (net::get_associated_allocator)(d_.handler());
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
d_.handler(), d_->ws.get_executor());
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(ping_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, ping_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(
|
||||
f, std::addressof(op->d_.handler()));
|
||||
}
|
||||
@@ -138,7 +138,7 @@ operator()(error_code ec, std::size_t)
|
||||
if(! d.ws.check_open(ec))
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
d.ws.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec));
|
||||
goto upcall;
|
||||
@@ -155,7 +155,7 @@ operator()(error_code ec, std::size_t)
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
d.ws.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(d.ws.wr_block_.is_locked(this));
|
||||
|
||||
@@ -166,7 +166,7 @@ operator()(error_code ec, std::size_t)
|
||||
|
||||
// Send ping frame
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(d.ws.stream_,
|
||||
net::async_write(d.ws.stream_,
|
||||
d.fb.data(), std::move(*this));
|
||||
if(! d.ws.check_ok(ec))
|
||||
goto upcall;
|
||||
@@ -207,7 +207,7 @@ ping(ping_data const& payload, error_code& ec)
|
||||
detail::frame_buffer fb;
|
||||
write_ping<flat_static_buffer_base>(
|
||||
fb, detail::opcode::ping, payload);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
net::write(stream_, fb.data(), ec);
|
||||
if(! check_ok(ec))
|
||||
return;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ pong(ping_data const& payload, error_code& ec)
|
||||
detail::frame_buffer fb;
|
||||
write_ping<flat_static_buffer_base>(
|
||||
fb, detail::opcode::pong, payload);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
net::write(stream_, fb.data(), ec);
|
||||
if(! check_ok(ec))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ template<
|
||||
class MutableBufferSequence,
|
||||
class Handler>
|
||||
class stream<NextLayer, deflateSupported>::read_some_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
Handler h_;
|
||||
stream<NextLayer, deflateSupported>& ws_;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg_;
|
||||
MutableBufferSequence bs_;
|
||||
buffers_suffix<MutableBufferSequence> cb_;
|
||||
@@ -115,21 +115,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, ws_.get_executor());
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(read_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return op->cont_ || asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -172,8 +172,8 @@ operator()(
|
||||
bool cont)
|
||||
{
|
||||
using beast::detail::clamp;
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer;
|
||||
using net::buffer_size;
|
||||
cont_ = cont;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
@@ -185,7 +185,7 @@ operator()(
|
||||
if( ws_.status_ == status::closed ||
|
||||
ws_.status_ == status::failed)
|
||||
{
|
||||
ec = boost::asio::error::operation_aborted;
|
||||
ec = net::error::operation_aborted;
|
||||
goto upcall;
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ operator()(
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(ws_.rd_block_.is_locked(this));
|
||||
|
||||
@@ -209,7 +209,7 @@ operator()(
|
||||
// a `close_op` wrote a close frame
|
||||
BOOST_ASSERT(ws_.wr_close_);
|
||||
BOOST_ASSERT(ws_.status_ != status::open);
|
||||
ec = boost::asio::error::operation_aborted;
|
||||
ec = net::error::operation_aborted;
|
||||
goto upcall;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ operator()(
|
||||
if(! cont_)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(),
|
||||
std::move(*this));
|
||||
BOOST_ASSERT(cont_);
|
||||
@@ -327,7 +327,7 @@ operator()(
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
|
||||
@@ -339,7 +339,7 @@ operator()(
|
||||
// Send pong
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(ws_.stream_,
|
||||
net::async_write(ws_.stream_,
|
||||
ws_.rd_fb_.data(), std::move(*this));
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
if(! ws_.check_ok(ec))
|
||||
@@ -359,7 +359,7 @@ operator()(
|
||||
if(! cont_)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(),
|
||||
std::move(*this));
|
||||
BOOST_ASSERT(cont_);
|
||||
@@ -385,7 +385,7 @@ operator()(
|
||||
if(! cont_)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(),
|
||||
std::move(*this));
|
||||
BOOST_ASSERT(cont_);
|
||||
@@ -461,7 +461,7 @@ operator()(
|
||||
{
|
||||
// Copy from the read buffer.
|
||||
// The mask was already applied.
|
||||
bytes_transferred = boost::asio::buffer_copy(cb_,
|
||||
bytes_transferred = net::buffer_copy(cb_,
|
||||
ws_.rd_buf_.data(), clamp(ws_.rd_remain_));
|
||||
auto const mb = buffers_prefix(
|
||||
bytes_transferred, cb_);
|
||||
@@ -639,7 +639,7 @@ operator()(
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
|
||||
@@ -664,7 +664,7 @@ operator()(
|
||||
// Send close frame
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(
|
||||
net::async_write(
|
||||
ws_.stream_, ws_.rd_fb_.data(),
|
||||
std::move(*this));
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
@@ -679,7 +679,7 @@ operator()(
|
||||
async_teardown(ws_.role_,
|
||||
ws_.stream_, std::move(*this));
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
if(ec == boost::asio::error::eof)
|
||||
if(ec == net::error::eof)
|
||||
{
|
||||
// Rationale:
|
||||
// http://stackoverflow.com/questions/25587403/boost-asio-ssl-async-shutdown-always-finishes-with-an-error
|
||||
@@ -703,7 +703,7 @@ operator()(
|
||||
if(! cont_)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this),
|
||||
ec, bytes_written_));
|
||||
@@ -719,11 +719,11 @@ template<
|
||||
class DynamicBuffer,
|
||||
class Handler>
|
||||
class stream<NextLayer, deflateSupported>::read_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
Handler h_;
|
||||
stream<NextLayer, deflateSupported>& ws_;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg_;
|
||||
DynamicBuffer& b_;
|
||||
std::size_t limit_;
|
||||
@@ -732,7 +732,7 @@ class stream<NextLayer, deflateSupported>::read_op
|
||||
|
||||
public:
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
read_op(read_op&&) = default;
|
||||
read_op(read_op const&) = delete;
|
||||
@@ -757,16 +757,16 @@ public:
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, ws_.get_executor());
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(read_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -786,7 +786,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, read_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -811,7 +811,7 @@ operator()(
|
||||
clamp(ws_.read_size_hint(b_), limit_),
|
||||
ec, error::buffer_overflow);
|
||||
if(ec)
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(*this), ec, 0));
|
||||
@@ -843,7 +843,7 @@ read(DynamicBuffer& buffer)
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
auto const bytes_written = read(buffer, ec);
|
||||
@@ -861,7 +861,7 @@ read(DynamicBuffer& buffer, error_code& ec)
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
std::size_t bytes_written = 0;
|
||||
do
|
||||
@@ -884,7 +884,7 @@ async_read(DynamicBuffer& buffer, ReadHandler&& handler)
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
ReadHandler, void(error_code, std::size_t));
|
||||
@@ -913,7 +913,7 @@ read_some(
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
error_code ec;
|
||||
auto const bytes_written =
|
||||
@@ -935,7 +935,7 @@ read_some(
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
using beast::detail::clamp;
|
||||
if(! limit)
|
||||
@@ -965,7 +965,7 @@ async_read_some(
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
ReadHandler, void(error_code, std::size_t));
|
||||
@@ -992,7 +992,7 @@ read_some(
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -1012,12 +1012,12 @@ read_some(
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
using beast::detail::clamp;
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer;
|
||||
using net::buffer_size;
|
||||
close_code code{};
|
||||
std::size_t bytes_written = 0;
|
||||
ec.assign(0, ec.category());
|
||||
@@ -1088,7 +1088,7 @@ loop:
|
||||
detail::frame_buffer fb;
|
||||
write_ping<flat_static_buffer_base>(fb,
|
||||
detail::opcode::pong, payload);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
net::write(stream_, fb.data(), ec);
|
||||
if(! check_ok(ec))
|
||||
return bytes_written;
|
||||
goto loop;
|
||||
@@ -1167,7 +1167,7 @@ loop:
|
||||
// Copy from the read buffer.
|
||||
// The mask was already applied.
|
||||
auto const bytes_transferred =
|
||||
boost::asio::buffer_copy(buffers,
|
||||
net::buffer_copy(buffers,
|
||||
rd_buf_.data(), clamp(rd_remain_));
|
||||
auto const mb = buffers_prefix(
|
||||
bytes_transferred, buffers);
|
||||
@@ -1349,7 +1349,7 @@ async_read_some(
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(boost::asio::is_mutable_buffer_sequence<
|
||||
static_assert(net::is_mutable_buffer_sequence<
|
||||
MutableBufferSequence>::value,
|
||||
"MutableBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
|
||||
@@ -35,7 +35,7 @@ template<class AsyncStream>
|
||||
void
|
||||
teardown(
|
||||
role_type,
|
||||
boost::asio::ssl::stream<AsyncStream>& stream,
|
||||
net::ssl::stream<AsyncStream>& stream,
|
||||
error_code& ec)
|
||||
{
|
||||
stream.shutdown(ec);
|
||||
@@ -47,7 +47,7 @@ template<
|
||||
void
|
||||
async_teardown(
|
||||
role_type,
|
||||
boost::asio::ssl::stream<AsyncStream>& stream,
|
||||
net::ssl::stream<AsyncStream>& stream,
|
||||
TeardownHandler&& handler)
|
||||
{
|
||||
stream.async_shutdown(
|
||||
|
||||
@@ -57,7 +57,7 @@ stream<NextLayer, deflateSupported>::
|
||||
read_size_hint(DynamicBuffer& buffer) const
|
||||
{
|
||||
static_assert(
|
||||
boost::asio::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
net::is_dynamic_buffer<DynamicBuffer>::value,
|
||||
"DynamicBuffer requirements not met");
|
||||
auto const initial_size = (std::min)(
|
||||
+tcp_frame_size,
|
||||
@@ -169,9 +169,9 @@ parse_fh(
|
||||
DynamicBuffer& b,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
if(buffer_size(b.data()) < 2)
|
||||
{
|
||||
// need more bytes
|
||||
@@ -403,8 +403,8 @@ write_close(DynamicBuffer& db, close_reason const& cr)
|
||||
::new(&tmp[0]) big_uint16_buf_t{
|
||||
(std::uint16_t)cr.code};
|
||||
auto mb = db.prepare(2);
|
||||
boost::asio::buffer_copy(mb,
|
||||
boost::asio::buffer(tmp));
|
||||
net::buffer_copy(mb,
|
||||
net::buffer(tmp));
|
||||
if(fh.mask)
|
||||
detail::mask_inplace(mb, key);
|
||||
db.commit(2);
|
||||
@@ -412,8 +412,8 @@ write_close(DynamicBuffer& db, close_reason const& cr)
|
||||
if(! cr.reason.empty())
|
||||
{
|
||||
auto mb = db.prepare(cr.reason.size());
|
||||
boost::asio::buffer_copy(mb,
|
||||
boost::asio::const_buffer(
|
||||
net::buffer_copy(mb,
|
||||
net::const_buffer(
|
||||
cr.reason.data(), cr.reason.size()));
|
||||
if(fh.mask)
|
||||
detail::mask_inplace(mb, key);
|
||||
@@ -446,8 +446,8 @@ write_ping(DynamicBuffer& db,
|
||||
if(fh.mask)
|
||||
detail::prepare_key(key, fh.key);
|
||||
auto mb = db.prepare(data.size());
|
||||
boost::asio::buffer_copy(mb,
|
||||
boost::asio::const_buffer(
|
||||
net::buffer_copy(mb,
|
||||
net::const_buffer(
|
||||
data.data(), data.size()));
|
||||
if(fh.mask)
|
||||
detail::mask_inplace(mb, key);
|
||||
@@ -642,13 +642,13 @@ do_fail(
|
||||
detail::frame_buffer fb;
|
||||
write_close<
|
||||
flat_static_buffer_base>(fb, code);
|
||||
boost::asio::write(stream_, fb.data(), ec);
|
||||
net::write(stream_, fb.data(), ec);
|
||||
if(! check_ok(ec))
|
||||
return;
|
||||
}
|
||||
using beast::websocket::teardown;
|
||||
teardown(role_, stream_, ec);
|
||||
if(ec == boost::asio::error::eof)
|
||||
if(ec == net::error::eof)
|
||||
{
|
||||
// Rationale:
|
||||
// http://stackoverflow.com/questions/25587403/boost-asio-ssl-async-shutdown-always-finishes-with-an-error
|
||||
|
||||
@@ -28,14 +28,14 @@ namespace websocket {
|
||||
namespace detail {
|
||||
|
||||
template<class Handler>
|
||||
class teardown_tcp_op : public boost::asio::coroutine
|
||||
class teardown_tcp_op : public net::coroutine
|
||||
{
|
||||
using socket_type =
|
||||
boost::asio::ip::tcp::socket;
|
||||
net::ip::tcp::socket;
|
||||
|
||||
Handler h_;
|
||||
socket_type& s_;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
socket_type&>().get_executor())> wg_;
|
||||
role_type role_;
|
||||
bool nb_;
|
||||
@@ -57,21 +57,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<socket_type&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, s_.get_executor());
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(teardown_tcp_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, teardown_tcp_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(f, std::addressof(op->h_));
|
||||
}
|
||||
};
|
||||
@@ -102,8 +102,8 @@ void
|
||||
teardown_tcp_op<Handler>::
|
||||
operator()(error_code ec, std::size_t bytes_transferred)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using tcp = boost::asio::ip::tcp;
|
||||
using net::buffer;
|
||||
using tcp = net::ip::tcp;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
nb_ = s_.non_blocking();
|
||||
@@ -116,7 +116,7 @@ operator()(error_code ec, std::size_t bytes_transferred)
|
||||
if(ec)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
s_.get_executor(),
|
||||
beast::bind_front_handler(std::move(*this), ec, 0));
|
||||
goto upcall;
|
||||
@@ -126,19 +126,19 @@ operator()(error_code ec, std::size_t bytes_transferred)
|
||||
{
|
||||
char buf[2048];
|
||||
s_.read_some(
|
||||
boost::asio::buffer(buf), ec);
|
||||
net::buffer(buf), ec);
|
||||
}
|
||||
if(ec == boost::asio::error::would_block)
|
||||
if(ec == net::error::would_block)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
s_.async_wait(
|
||||
boost::asio::ip::tcp::socket::wait_read,
|
||||
net::ip::tcp::socket::wait_read,
|
||||
std::move(*this));
|
||||
continue;
|
||||
}
|
||||
if(ec)
|
||||
{
|
||||
if(ec != boost::asio::error::eof)
|
||||
if(ec != net::error::eof)
|
||||
goto upcall;
|
||||
ec = {};
|
||||
break;
|
||||
@@ -171,13 +171,13 @@ inline
|
||||
void
|
||||
teardown(
|
||||
role_type role,
|
||||
boost::asio::ip::tcp::socket& socket,
|
||||
net::ip::tcp::socket& socket,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using net::buffer;
|
||||
if(role == role_type::server)
|
||||
socket.shutdown(
|
||||
boost::asio::ip::tcp::socket::shutdown_send, ec);
|
||||
net::ip::tcp::socket::shutdown_send, ec);
|
||||
if(ec)
|
||||
return;
|
||||
for(;;)
|
||||
@@ -187,7 +187,7 @@ teardown(
|
||||
socket.read_some(buffer(buf), ec);
|
||||
if(ec)
|
||||
{
|
||||
if(ec != boost::asio::error::eof)
|
||||
if(ec != net::error::eof)
|
||||
return;
|
||||
ec = {};
|
||||
break;
|
||||
@@ -200,7 +200,7 @@ teardown(
|
||||
}
|
||||
if(role == role_type::client)
|
||||
socket.shutdown(
|
||||
boost::asio::ip::tcp::socket::shutdown_send, ec);
|
||||
net::ip::tcp::socket::shutdown_send, ec);
|
||||
if(ec)
|
||||
return;
|
||||
socket.close(ec);
|
||||
@@ -211,7 +211,7 @@ inline
|
||||
void
|
||||
async_teardown(
|
||||
role_type role,
|
||||
boost::asio::ip::tcp::socket& socket,
|
||||
net::ip::tcp::socket& socket,
|
||||
TeardownHandler&& handler)
|
||||
{
|
||||
static_assert(beast::is_completion_handler<
|
||||
|
||||
@@ -46,13 +46,13 @@ template<class ConstBufferSequence>
|
||||
bool
|
||||
stream_base<true>::
|
||||
deflate(
|
||||
boost::asio::mutable_buffer& out,
|
||||
net::mutable_buffer& out,
|
||||
buffers_suffix<ConstBufferSequence>& cb,
|
||||
bool fin,
|
||||
std::size_t& total_in,
|
||||
error_code& ec)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
using net::buffer;
|
||||
BOOST_ASSERT(out.size() >= 6);
|
||||
auto& zo = this->pmd_->zo;
|
||||
zlib::z_params zs;
|
||||
@@ -87,7 +87,7 @@ deflate(
|
||||
cb.consume(zs.total_in);
|
||||
if(zs.avail_out > 0 && fin)
|
||||
{
|
||||
auto const remain = boost::asio::buffer_size(cb);
|
||||
auto const remain = net::buffer_size(cb);
|
||||
if(remain == 0)
|
||||
{
|
||||
// Inspired by Mark Adler
|
||||
@@ -139,11 +139,11 @@ do_context_takeover_write(role_type role)
|
||||
template<class NextLayer, bool deflateSupported>
|
||||
template<class Buffers, class Handler>
|
||||
class stream<NextLayer, deflateSupported>::write_some_op
|
||||
: public boost::asio::coroutine
|
||||
: public net::coroutine
|
||||
{
|
||||
Handler h_;
|
||||
stream<NextLayer, deflateSupported>& ws_;
|
||||
boost::asio::executor_work_guard<decltype(std::declval<
|
||||
net::executor_work_guard<decltype(std::declval<
|
||||
stream<NextLayer, deflateSupported>&>().get_executor())> wg_;
|
||||
buffers_suffix<Buffers> cb_;
|
||||
detail::frame_header fh_;
|
||||
@@ -177,21 +177,21 @@ public:
|
||||
}
|
||||
|
||||
using allocator_type =
|
||||
boost::asio::associated_allocator_t<Handler>;
|
||||
net::associated_allocator_t<Handler>;
|
||||
|
||||
allocator_type
|
||||
get_allocator() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_allocator)(h_);
|
||||
return (net::get_associated_allocator)(h_);
|
||||
}
|
||||
|
||||
using executor_type = boost::asio::associated_executor_t<
|
||||
using executor_type = net::associated_executor_t<
|
||||
Handler, decltype(std::declval<stream<NextLayer, deflateSupported>&>().get_executor())>;
|
||||
|
||||
executor_type
|
||||
get_executor() const noexcept
|
||||
{
|
||||
return (boost::asio::get_associated_executor)(
|
||||
return (net::get_associated_executor)(
|
||||
h_, ws_.get_executor());
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
friend
|
||||
bool asio_handler_is_continuation(write_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_is_continuation;
|
||||
using net::asio_handler_is_continuation;
|
||||
return op->cont_ || asio_handler_is_continuation(
|
||||
std::addressof(op->h_));
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
friend
|
||||
void asio_handler_invoke(Function&& f, write_some_op* op)
|
||||
{
|
||||
using boost::asio::asio_handler_invoke;
|
||||
using net::asio_handler_invoke;
|
||||
asio_handler_invoke(
|
||||
f, std::addressof(op->h_));
|
||||
}
|
||||
@@ -235,10 +235,10 @@ operator()(
|
||||
bool cont)
|
||||
{
|
||||
using beast::detail::clamp;
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using boost::asio::mutable_buffer;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
using net::mutable_buffer;
|
||||
enum
|
||||
{
|
||||
do_nomask_nofrag,
|
||||
@@ -248,7 +248,7 @@ operator()(
|
||||
do_deflate
|
||||
};
|
||||
std::size_t n;
|
||||
boost::asio::mutable_buffer b;
|
||||
net::mutable_buffer b;
|
||||
cont_ = cont;
|
||||
BOOST_ASIO_CORO_REENTER(*this)
|
||||
{
|
||||
@@ -326,7 +326,7 @@ operator()(
|
||||
|
||||
// Resume
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(), std::move(*this));
|
||||
BOOST_ASSERT(ws_.wr_block_.is_locked(this));
|
||||
|
||||
@@ -347,7 +347,7 @@ operator()(
|
||||
ws_.wr_cont_ = ! fin_;
|
||||
// Send frame
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(ws_.stream_,
|
||||
net::async_write(ws_.stream_,
|
||||
buffers_cat(ws_.wr_fb_.data(), cb_),
|
||||
std::move(*this));
|
||||
if(! ws_.check_ok(ec))
|
||||
@@ -372,7 +372,7 @@ operator()(
|
||||
ws_.wr_cont_ = ! fin_;
|
||||
// Send frame
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(
|
||||
net::async_write(
|
||||
ws_.stream_, buffers_cat(
|
||||
ws_.wr_fb_.data(), buffers_prefix(
|
||||
clamp(fh_.len), cb_)),
|
||||
@@ -421,7 +421,7 @@ operator()(
|
||||
ws_.wr_cont_ = ! fin_;
|
||||
// Send frame header and partial payload
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(
|
||||
net::async_write(
|
||||
ws_.stream_, buffers_cat(ws_.wr_fb_.data(),
|
||||
buffer(ws_.wr_buf_.get(), n)),
|
||||
std::move(*this));
|
||||
@@ -440,7 +440,7 @@ operator()(
|
||||
remain_ -= n;
|
||||
// Send partial payload
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(ws_.stream_,
|
||||
net::async_write(ws_.stream_,
|
||||
buffer(ws_.wr_buf_.get(), n),
|
||||
std::move(*this));
|
||||
if(! ws_.check_ok(ec))
|
||||
@@ -472,7 +472,7 @@ operator()(
|
||||
ws_.wr_cont_ = ! fin_;
|
||||
// Send frame
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(ws_.stream_,
|
||||
net::async_write(ws_.stream_,
|
||||
buffers_cat(ws_.wr_fb_.data(),
|
||||
buffer(ws_.wr_buf_.get(), n)),
|
||||
std::move(*this));
|
||||
@@ -535,7 +535,7 @@ operator()(
|
||||
ws_.wr_cont_ = ! fin_;
|
||||
// Send frame
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::async_write(ws_.stream_,
|
||||
net::async_write(ws_.stream_,
|
||||
buffers_cat(ws_.wr_fb_.data(), b),
|
||||
std::move(*this));
|
||||
if(! ws_.check_ok(ec))
|
||||
@@ -576,7 +576,7 @@ operator()(
|
||||
if(! cont_)
|
||||
{
|
||||
BOOST_ASIO_CORO_YIELD
|
||||
boost::asio::post(
|
||||
net::post(
|
||||
ws_.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
std::move(*this),
|
||||
@@ -596,7 +596,7 @@ write_some(bool fin, ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -616,13 +616,13 @@ write_some(bool fin,
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
using beast::detail::clamp;
|
||||
using boost::asio::buffer;
|
||||
using boost::asio::buffer_copy;
|
||||
using boost::asio::buffer_size;
|
||||
using net::buffer;
|
||||
using net::buffer_copy;
|
||||
using net::buffer_size;
|
||||
std::size_t bytes_transferred = 0;
|
||||
ec.assign(0, ec.category());
|
||||
// Make sure the stream is open
|
||||
@@ -680,7 +680,7 @@ write_some(bool fin,
|
||||
detail::write<
|
||||
flat_static_buffer_base>(fh_buf, fh);
|
||||
wr_cont_ = ! fin;
|
||||
boost::asio::write(stream_,
|
||||
net::write(stream_,
|
||||
buffers_cat(fh_buf.data(), b), ec);
|
||||
if(! check_ok(ec))
|
||||
return bytes_transferred;
|
||||
@@ -703,7 +703,7 @@ write_some(bool fin,
|
||||
detail::write<
|
||||
flat_static_buffer_base>(fh_buf, fh);
|
||||
wr_cont_ = ! fin;
|
||||
boost::asio::write(stream_,
|
||||
net::write(stream_,
|
||||
buffers_cat(fh_buf.data(), buffers), ec);
|
||||
if(! check_ok(ec))
|
||||
return bytes_transferred;
|
||||
@@ -725,7 +725,7 @@ write_some(bool fin,
|
||||
detail::write<
|
||||
flat_static_buffer_base>(fh_buf, fh);
|
||||
wr_cont_ = ! fin;
|
||||
boost::asio::write(stream_,
|
||||
net::write(stream_,
|
||||
buffers_cat(fh_buf.data(),
|
||||
buffers_prefix(n, cb)), ec);
|
||||
if(! check_ok(ec))
|
||||
@@ -759,7 +759,7 @@ write_some(bool fin,
|
||||
remain -= n;
|
||||
detail::mask_inplace(b, key);
|
||||
wr_cont_ = ! fin;
|
||||
boost::asio::write(stream_,
|
||||
net::write(stream_,
|
||||
buffers_cat(fh_buf.data(), b), ec);
|
||||
if(! check_ok(ec))
|
||||
return bytes_transferred;
|
||||
@@ -773,7 +773,7 @@ write_some(bool fin,
|
||||
cb.consume(n);
|
||||
remain -= n;
|
||||
detail::mask_inplace(b, key);
|
||||
boost::asio::write(stream_, b, ec);
|
||||
net::write(stream_, b, ec);
|
||||
if(! check_ok(ec))
|
||||
return bytes_transferred;
|
||||
bytes_transferred += n;
|
||||
@@ -801,7 +801,7 @@ write_some(bool fin,
|
||||
detail::fh_buffer fh_buf;
|
||||
detail::write<
|
||||
flat_static_buffer_base>(fh_buf, fh);
|
||||
boost::asio::write(stream_,
|
||||
net::write(stream_,
|
||||
buffers_cat(fh_buf.data(), b), ec);
|
||||
if(! check_ok(ec))
|
||||
return bytes_transferred;
|
||||
@@ -825,7 +825,7 @@ async_write_some(bool fin,
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
@@ -847,7 +847,7 @@ write(ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
error_code ec;
|
||||
@@ -865,7 +865,7 @@ write(ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
return write_some(true, buffers, ec);
|
||||
@@ -881,7 +881,7 @@ async_write(
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements not met");
|
||||
static_assert(boost::asio::is_const_buffer_sequence<
|
||||
static_assert(net::is_const_buffer_sequence<
|
||||
ConstBufferSequence>::value,
|
||||
"ConstBufferSequence requirements not met");
|
||||
BOOST_BEAST_HANDLER_INIT(
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace websocket {
|
||||
|
||||
@par Example
|
||||
@code
|
||||
void handle_connection(boost::asio::ip::tcp::socket& sock)
|
||||
void handle_connection(net::ip::tcp::socket& sock)
|
||||
{
|
||||
boost::beast::flat_buffer buffer;
|
||||
boost::beast::http::request<boost::beast::http::string_body> req;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace websocket {
|
||||
performing the close operation.
|
||||
|
||||
The default implementation for @ref stream when the next
|
||||
layer type is a `boost::asio::ip::tcp::socket` behaves
|
||||
layer type is a `net::ip::tcp::socket` behaves
|
||||
as follows:
|
||||
|
||||
@li In the client role, a TCP/IP shutdown is sent after
|
||||
@@ -37,7 +37,7 @@ namespace websocket {
|
||||
@li In the server role, a TCP/IP shutdown is sent before
|
||||
reading all remaining data on the connection.
|
||||
|
||||
When the next layer type is a `boost::asio::ssl::stream`,
|
||||
When the next layer type is a `net::ssl::stream`,
|
||||
the connection is closed by performing the SSL closing
|
||||
handshake corresponding to the role type, client or server.
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ namespace boost {
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
/** Tear down a `boost::asio::ssl::stream`.
|
||||
/** Tear down a `net::ssl::stream`.
|
||||
|
||||
This tears down a connection. The implementation will call
|
||||
the overload of this function based on the `Stream` parameter
|
||||
used to consruct the socket. When `Stream` is a user defined
|
||||
type, and not a `boost::asio::ip::tcp::socket` or any
|
||||
`boost::asio::ssl::stream`, callers are responsible for
|
||||
type, and not a `net::ip::tcp::socket` or any
|
||||
`net::ssl::stream`, callers are responsible for
|
||||
providing a suitable overload of this function.
|
||||
|
||||
@param role The role of the local endpoint
|
||||
@@ -38,16 +38,16 @@ template<class SyncStream>
|
||||
void
|
||||
teardown(
|
||||
role_type role,
|
||||
boost::asio::ssl::stream<SyncStream>& stream,
|
||||
net::ssl::stream<SyncStream>& stream,
|
||||
error_code& ec);
|
||||
|
||||
/** Start tearing down a `boost::asio::ssl::stream`.
|
||||
/** Start tearing down a `net::ssl::stream`.
|
||||
|
||||
This begins tearing down a connection asynchronously.
|
||||
The implementation will call the overload of this function
|
||||
based on the `Stream` parameter used to consruct the socket.
|
||||
When `Stream` is a user defined type, and not a
|
||||
`boost::asio::ip::tcp::socket` or any `boost::asio::ssl::stream`,
|
||||
`net::ip::tcp::socket` or any `net::ssl::stream`,
|
||||
callers are responsible for providing a suitable overload
|
||||
of this function.
|
||||
|
||||
@@ -64,7 +64,7 @@ teardown(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using boost::asio::io_context::post().
|
||||
manner equivalent to using net::io_context::post().
|
||||
|
||||
*/
|
||||
template<class AsyncStream, class TeardownHandler>
|
||||
@@ -72,7 +72,7 @@ inline
|
||||
void
|
||||
async_teardown(
|
||||
role_type role,
|
||||
boost::asio::ssl::stream<AsyncStream>& stream,
|
||||
net::ssl::stream<AsyncStream>& stream,
|
||||
TeardownHandler&& handler);
|
||||
|
||||
} // websocket
|
||||
|
||||
@@ -1209,7 +1209,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class HandshakeHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -1261,7 +1261,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class HandshakeHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -1319,7 +1319,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class RequestDecorator, class HandshakeHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -1381,7 +1381,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class RequestDecorator, class HandshakeHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -1956,7 +1956,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class AcceptHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -2017,7 +2017,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class ResponseDecorator,
|
||||
@@ -2080,7 +2080,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
@@ -2158,7 +2158,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
@@ -2219,7 +2219,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class Body, class Allocator,
|
||||
@@ -2282,7 +2282,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class Body, class Allocator,
|
||||
@@ -2401,7 +2401,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class CloseHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -2464,7 +2464,7 @@ public:
|
||||
|
||||
If a close frame is sent or received before the ping frame is
|
||||
sent, the completion handler will be called with the error
|
||||
set to `boost::asio::error::operation_aborted`.
|
||||
set to `net::error::operation_aborted`.
|
||||
|
||||
@param payload The payload of the ping message, which may be empty.
|
||||
|
||||
@@ -2479,7 +2479,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -2557,7 +2557,7 @@ public:
|
||||
|
||||
If a close frame is sent or received before the pong frame is
|
||||
sent, the completion handler will be called with the error
|
||||
set to `boost::asio::error::operation_aborted`.
|
||||
set to `net::error::operation_aborted`.
|
||||
|
||||
@param payload The payload of the pong message, which may be empty.
|
||||
|
||||
@@ -2572,7 +2572,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -2731,7 +2731,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class DynamicBuffer, class ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -2911,7 +2911,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class DynamicBuffer, class ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -3084,7 +3084,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<class MutableBufferSequence, class ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(
|
||||
@@ -3225,7 +3225,7 @@ public:
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_context::post`.
|
||||
manner equivalent to using `net::io_context::post`.
|
||||
*/
|
||||
template<
|
||||
class ConstBufferSequence,
|
||||
@@ -3384,7 +3384,7 @@ private:
|
||||
{
|
||||
if(status_ != status::open)
|
||||
{
|
||||
ec = boost::asio::error::operation_aborted;
|
||||
ec = net::error::operation_aborted;
|
||||
return false;
|
||||
}
|
||||
ec.assign(0, ec.category());
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace websocket {
|
||||
This tears down a connection. The implementation will call
|
||||
the overload of this function based on the `Socket` parameter
|
||||
used to consruct the socket. When `Socket` is a user defined
|
||||
type, and not a `boost::asio::ip::tcp::socket` or any
|
||||
`boost::asio::ssl::stream`, callers are responsible for
|
||||
type, and not a `net::ip::tcp::socket` or any
|
||||
`net::ssl::stream`, callers are responsible for
|
||||
providing a suitable overload of this function.
|
||||
|
||||
@param role The role of the local endpoint
|
||||
@@ -61,7 +61,7 @@ teardown(
|
||||
The implementation will call the overload of this function
|
||||
based on the `Socket` parameter used to consruct the socket.
|
||||
When `Stream` is a user defined type, and not a
|
||||
`boost::asio::ip::tcp::socket` or any `boost::asio::ssl::stream`,
|
||||
`net::ip::tcp::socket` or any `net::ssl::stream`,
|
||||
callers are responsible for providing a suitable overload
|
||||
of this function.
|
||||
|
||||
@@ -79,7 +79,7 @@ teardown(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using boost::asio::io_context::post().
|
||||
manner equivalent to using net::io_context::post().
|
||||
|
||||
*/
|
||||
template<
|
||||
@@ -110,13 +110,13 @@ async_teardown(
|
||||
|
||||
namespace websocket {
|
||||
|
||||
/** Tear down a `boost::asio::ip::tcp::socket`.
|
||||
/** Tear down a `net::ip::tcp::socket`.
|
||||
|
||||
This tears down a connection. The implementation will call
|
||||
the overload of this function based on the `Stream` parameter
|
||||
used to consruct the socket. When `Stream` is a user defined
|
||||
type, and not a `boost::asio::ip::tcp::socket` or any
|
||||
`boost::asio::ssl::stream`, callers are responsible for
|
||||
type, and not a `net::ip::tcp::socket` or any
|
||||
`net::ssl::stream`, callers are responsible for
|
||||
providing a suitable overload of this function.
|
||||
|
||||
@param role The role of the local endpoint
|
||||
@@ -128,16 +128,16 @@ namespace websocket {
|
||||
void
|
||||
teardown(
|
||||
role_type role,
|
||||
boost::asio::ip::tcp::socket& socket,
|
||||
net::ip::tcp::socket& socket,
|
||||
error_code& ec);
|
||||
|
||||
/** Start tearing down a `boost::asio::ip::tcp::socket`.
|
||||
/** Start tearing down a `net::ip::tcp::socket`.
|
||||
|
||||
This begins tearing down a connection asynchronously.
|
||||
The implementation will call the overload of this function
|
||||
based on the `Stream` parameter used to consruct the socket.
|
||||
When `Stream` is a user defined type, and not a
|
||||
`boost::asio::ip::tcp::socket` or any `boost::asio::ssl::stream`,
|
||||
`net::ip::tcp::socket` or any `net::ssl::stream`,
|
||||
callers are responsible for providing a suitable overload
|
||||
of this function.
|
||||
|
||||
@@ -155,14 +155,14 @@ teardown(
|
||||
Regardless of whether the asynchronous operation completes
|
||||
immediately or not, the handler will not be invoked from within
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using boost::asio::io_context::post().
|
||||
manner equivalent to using net::io_context::post().
|
||||
|
||||
*/
|
||||
template<class TeardownHandler>
|
||||
void
|
||||
async_teardown(
|
||||
role_type role,
|
||||
boost::asio::ip::tcp::socket& socket,
|
||||
net::ip::tcp::socket& socket,
|
||||
TeardownHandler&& handler);
|
||||
|
||||
} // websocket
|
||||
|
||||
Reference in New Issue
Block a user