mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 04:47:29 +02:00
Narrow the use of Fields parameters:
Every interface or implementation which operates on a templated type Fields is evaluated to determine if basic_fields<Allocator> is more appropriate, and changed if so.
This commit is contained in:
@ -47,12 +47,12 @@ namespace http {
|
||||
template<
|
||||
class SyncStream,
|
||||
class DynamicBuffer,
|
||||
class Body, class Fields>
|
||||
class Body, class Allocator>
|
||||
void
|
||||
send_expect_100_continue(
|
||||
SyncStream& stream,
|
||||
DynamicBuffer& buffer,
|
||||
request<Body, Fields>& req,
|
||||
request<Body, basic_fields<Allocator>>& req,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<SyncStream>::value,
|
||||
|
@ -273,12 +273,12 @@ public:
|
||||
|
||||
@param req The upgrade request.
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
on_upgrade(
|
||||
socket_type&& sock,
|
||||
endpoint_type ep,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
{
|
||||
// Create the connection and call the version of
|
||||
// run that takes the request since we have it already
|
||||
@ -304,12 +304,12 @@ public:
|
||||
|
||||
@param req The upgrade request.
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
on_upgrade(
|
||||
ssl_stream<socket_type>&& stream,
|
||||
endpoint_type ep,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
{
|
||||
std::make_shared<async_wss_con>(
|
||||
std::move(stream),
|
||||
|
@ -26,9 +26,10 @@ namespace rfc7231 {
|
||||
|
||||
@see https://tools.ietf.org/html/rfc7231#section-5.1.1
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body, class Allocator>
|
||||
bool
|
||||
is_expect_100_continue(beast::http::request<Body, Fields> const& req)
|
||||
is_expect_100_continue(beast::http::request<
|
||||
Body, beast::http::basic_fields<Allocator>> const& req)
|
||||
{
|
||||
return beast::iequals(
|
||||
req[beast::http::field::expect], "100-continue");
|
||||
|
@ -98,9 +98,9 @@ public:
|
||||
|
||||
@code
|
||||
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
send(response<Body, Fields>&&);
|
||||
send(response<Body>&&);
|
||||
|
||||
@endcode
|
||||
|
||||
@ -112,13 +112,13 @@ public:
|
||||
*/
|
||||
template<
|
||||
class Stream,
|
||||
class Body, class Fields,
|
||||
class Body,
|
||||
class Send>
|
||||
bool
|
||||
respond(
|
||||
Stream&& stream,
|
||||
endpoint_type const& ep,
|
||||
beast::http::request<Body, Fields>&& req,
|
||||
beast::http::request<Body>&& req,
|
||||
Send const& send) const
|
||||
{
|
||||
return try_respond(
|
||||
@ -135,13 +135,13 @@ private:
|
||||
*/
|
||||
template<
|
||||
class Stream,
|
||||
class Body, class Fields,
|
||||
class Body,
|
||||
class Send>
|
||||
bool
|
||||
try_respond(
|
||||
Stream&&,
|
||||
endpoint_type const&,
|
||||
beast::http::request<Body, Fields>&&,
|
||||
beast::http::request<Body>&&,
|
||||
Send const&,
|
||||
C<sizeof...(Services)> const&) const
|
||||
{
|
||||
@ -155,14 +155,14 @@ private:
|
||||
//
|
||||
template<
|
||||
class Stream,
|
||||
class Body, class Fields,
|
||||
class Body,
|
||||
class Send,
|
||||
std::size_t I>
|
||||
bool
|
||||
try_respond(
|
||||
Stream&& stream,
|
||||
endpoint_type const& ep,
|
||||
beast::http::request<Body, Fields>&& req,
|
||||
beast::http::request<Body>&& req,
|
||||
Send const& send,
|
||||
C<I> const&) const
|
||||
{
|
||||
|
@ -90,9 +90,9 @@ public:
|
||||
// This overload handles the case where we
|
||||
// already have the WebSocket Upgrade request.
|
||||
//
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
run(beast::http::request<Body, Fields> const& req)
|
||||
run(beast::http::request<Body> const& req)
|
||||
{
|
||||
// Call the overload of accept() which takes
|
||||
// the request by parameter, instead of reading
|
||||
@ -352,12 +352,12 @@ public:
|
||||
|
||||
@param req The upgrade request.
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
on_upgrade(
|
||||
socket_type&& sock,
|
||||
endpoint_type ep,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
{
|
||||
std::make_shared<async_ws_con>(
|
||||
std::move(sock),
|
||||
|
@ -93,9 +93,9 @@ public:
|
||||
|
||||
// Run the connection from an already-received Upgrade request.
|
||||
//
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
run(beast::http::request<Body, Fields>&& req)
|
||||
run(beast::http::request<Body>&& req)
|
||||
{
|
||||
BOOST_ASSERT(beast::websocket::is_upgrade(req));
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
// so we have to write it out by manually specifying the lambda.
|
||||
//
|
||||
std::thread{
|
||||
lambda<Body, Fields>{
|
||||
lambda<Body>{
|
||||
impl().shared_from_this(),
|
||||
std::move(req)
|
||||
}}.detach();
|
||||
@ -168,11 +168,11 @@ private:
|
||||
// we write out the lambda ourselves. This is similar to what
|
||||
// the compiler would generate anyway.
|
||||
//
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
class lambda
|
||||
{
|
||||
std::shared_ptr<sync_ws_con_base> self_;
|
||||
beast::http::request<Body, Fields> req_;
|
||||
beast::http::request<Body> req_;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
@ -181,7 +181,7 @@ private:
|
||||
//
|
||||
lambda(
|
||||
std::shared_ptr<sync_ws_con_base> self,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
: self_(std::move(self))
|
||||
, req_(std::move(req))
|
||||
{
|
||||
@ -407,12 +407,12 @@ public:
|
||||
|
||||
@param req The upgrade request.
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
on_upgrade(
|
||||
socket_type&& sock,
|
||||
endpoint_type ep,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
{
|
||||
// Create the connection object and run it,
|
||||
// transferring ownership of the ugprade request.
|
||||
|
@ -67,13 +67,13 @@ public:
|
||||
*/
|
||||
template<
|
||||
class Stream,
|
||||
class Body, class Fields,
|
||||
class Body,
|
||||
class Send>
|
||||
bool
|
||||
respond(
|
||||
Stream&& stream,
|
||||
endpoint_type const& ep,
|
||||
beast::http::request<Body, Fields>&& req,
|
||||
beast::http::request<Body>&& req,
|
||||
Send const&) const
|
||||
{
|
||||
// If its not an upgrade request, return `false`
|
||||
|
@ -291,12 +291,12 @@ public:
|
||||
|
||||
@param req The upgrade request.
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
on_upgrade(
|
||||
ssl_stream<socket_type>&& stream,
|
||||
endpoint_type ep,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
{
|
||||
// Create the connection object and run it,
|
||||
// transferring ownership of the ugprade request.
|
||||
@ -415,12 +415,12 @@ public:
|
||||
|
||||
@param req The upgrade request.
|
||||
*/
|
||||
template<class Body, class Fields>
|
||||
template<class Body>
|
||||
void
|
||||
on_upgrade(
|
||||
ssl_stream<socket_type>&& stream,
|
||||
endpoint_type ep,
|
||||
beast::http::request<Body, Fields>&& req)
|
||||
beast::http::request<Body>&& req)
|
||||
{
|
||||
std::make_shared<async_wss_con>(
|
||||
std::move(stream),
|
||||
|
@ -66,9 +66,10 @@ parse_bits(string_view s)
|
||||
|
||||
// Parse permessage-deflate request fields
|
||||
//
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
pmd_read(pmd_offer& offer, Fields const& fields)
|
||||
pmd_read(pmd_offer& offer,
|
||||
http::basic_fields<Allocator> const& fields)
|
||||
{
|
||||
offer.accept = false;
|
||||
offer.server_max_window_bits= 0;
|
||||
@ -194,9 +195,10 @@ pmd_read(pmd_offer& offer, Fields const& fields)
|
||||
|
||||
// Set permessage-deflate fields for a client offer
|
||||
//
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
pmd_write(Fields& fields, pmd_offer const& offer)
|
||||
pmd_write(http::basic_fields<Allocator>& fields,
|
||||
pmd_offer const& offer)
|
||||
{
|
||||
static_string<512> s;
|
||||
s = "permessage-deflate";
|
||||
@ -239,10 +241,10 @@ pmd_write(Fields& fields, pmd_offer const& offer)
|
||||
|
||||
// Negotiate a permessage-deflate client offer
|
||||
//
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
pmd_negotiate(
|
||||
Fields& fields,
|
||||
http::basic_fields<Allocator>& fields,
|
||||
pmd_offer& config,
|
||||
pmd_offer const& offer,
|
||||
permessage_deflate const& o)
|
||||
|
@ -42,9 +42,9 @@ class stream<NextLayer>::response_op
|
||||
response_type res;
|
||||
int state = 0;
|
||||
|
||||
template<class Fields, class Decorator>
|
||||
data(Handler&, stream<NextLayer>& ws_,
|
||||
http::header<true, Fields> const& req,
|
||||
template<class Allocator, class Decorator>
|
||||
data(Handler&, stream<NextLayer>& ws_, http::header<
|
||||
true, http::basic_fields<Allocator>> const& req,
|
||||
Decorator const& decorator,
|
||||
bool cont_)
|
||||
: cont(cont_)
|
||||
@ -53,10 +53,10 @@ class stream<NextLayer>::response_op
|
||||
{
|
||||
}
|
||||
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class Buffers, class Decorator>
|
||||
data(Handler&, stream<NextLayer>& ws_,
|
||||
http::header<true, Fields> const& req,
|
||||
data(Handler&, stream<NextLayer>& ws_, http::header<
|
||||
true, http::basic_fields<Allocator>> const& req,
|
||||
Buffers const& buffers,
|
||||
Decorator const& decorator,
|
||||
bool cont_)
|
||||
@ -443,10 +443,11 @@ accept_ex(ConstBufferSequence const& buffers,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept(http::header<true, Fields> const& req)
|
||||
accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -457,10 +458,11 @@ accept(http::header<true, Fields> const& req)
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class ResponseDecorator>
|
||||
template<class Allocator, class ResponseDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ResponseDecorator const& decorator)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
@ -475,11 +477,12 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept(http::header<true, Fields> const& req,
|
||||
error_code& ec)
|
||||
accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -488,11 +491,12 @@ accept(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class ResponseDecorator>
|
||||
template<class Allocator, class ResponseDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ResponseDecorator const& decorator, error_code& ec)
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ResponseDecorator const& decorator, error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -504,11 +508,12 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class ConstBufferSequence>
|
||||
template<class Allocator, class ConstBufferSequence>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers)
|
||||
accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -522,13 +527,14 @@ accept(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class ConstBufferSequence, class ResponseDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator)
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -545,11 +551,12 @@ accept_ex(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class ConstBufferSequence>
|
||||
template<class Allocator, class ConstBufferSequence>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers, error_code& ec)
|
||||
accept(http::header<true,
|
||||
Allocator> const& req,
|
||||
ConstBufferSequence const& buffers, error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -566,14 +573,15 @@ accept(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class ConstBufferSequence, class ResponseDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
error_code& ec)
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(is_sync_stream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -688,12 +696,13 @@ async_accept_ex(ConstBufferSequence const& buffers,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class AcceptHandler>
|
||||
template<class Allocator, class AcceptHandler>
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
stream<NextLayer>::
|
||||
async_accept(http::header<true, Fields> const& req,
|
||||
AcceptHandler&& handler)
|
||||
async_accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
@ -710,13 +719,14 @@ async_accept(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
stream<NextLayer>::
|
||||
async_accept_ex(http::header<true, Fields> const& req,
|
||||
ResponseDecorator const& decorator, AcceptHandler&& handler)
|
||||
async_accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ResponseDecorator const& decorator, AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
@ -736,14 +746,15 @@ async_accept_ex(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class ConstBufferSequence, class AcceptHandler>
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
stream<NextLayer>::
|
||||
async_accept(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
AcceptHandler&& handler)
|
||||
async_accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
@ -763,15 +774,16 @@ async_accept(http::header<true, Fields> const& req,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class ConstBufferSequence,
|
||||
template<class Allocator, class ConstBufferSequence,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
stream<NextLayer>::
|
||||
async_accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler)
|
||||
async_accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler)
|
||||
{
|
||||
static_assert(is_async_stream<next_layer_type>::value,
|
||||
"AsyncStream requirements requirements not met");
|
||||
|
@ -8,14 +8,16 @@
|
||||
#ifndef BEAST_WEBSOCKET_IMPL_RFC6455_IPP
|
||||
#define BEAST_WEBSOCKET_IMPL_RFC6455_IPP
|
||||
|
||||
#include <beast/http/fields.hpp>
|
||||
#include <beast/http/rfc7230.hpp>
|
||||
|
||||
namespace beast {
|
||||
namespace websocket {
|
||||
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
bool
|
||||
is_upgrade(http::header<true, Fields> const& req)
|
||||
is_upgrade(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req)
|
||||
{
|
||||
if(req.version < 11)
|
||||
return false;
|
||||
|
@ -101,11 +101,12 @@ do_accept(
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class Decorator>
|
||||
template<class Allocator, class Decorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
do_accept(http::header<true, Fields> const& req,
|
||||
Decorator const& decorator, error_code& ec)
|
||||
do_accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
Decorator const& decorator, error_code& ec)
|
||||
{
|
||||
auto const res = build_response(req, decorator);
|
||||
http::write(stream_, res, ec);
|
||||
@ -192,11 +193,12 @@ build_request(detail::sec_ws_key_type& key,
|
||||
}
|
||||
|
||||
template<class NextLayer>
|
||||
template<class Fields, class Decorator>
|
||||
template<class Allocator, class Decorator>
|
||||
response_type
|
||||
stream<NextLayer>::
|
||||
build_response(http::header<true, Fields> const& req,
|
||||
Decorator const& decorator)
|
||||
build_response(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
Decorator const& decorator)
|
||||
{
|
||||
auto const decorate =
|
||||
[&decorator](response_type& res)
|
||||
|
@ -50,9 +50,10 @@ namespace websocket {
|
||||
|
||||
@return `true` if the request is a WebSocket Upgrade.
|
||||
*/
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
bool
|
||||
is_upgrade(beast::http::header<true, Fields> const& req);
|
||||
is_upgrade(beast::http::header<true,
|
||||
http::basic_fields<Allocator>> const& req);
|
||||
|
||||
/** Close status codes.
|
||||
|
||||
|
@ -836,9 +836,9 @@ public:
|
||||
|
||||
@throws system_error Thrown on failure.
|
||||
*/
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
accept(http::header<true, Fields> const& req);
|
||||
accept(http::header<true, http::basic_fields<Allocator>> const& req);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
|
||||
@ -877,10 +877,11 @@ public:
|
||||
|
||||
@throws system_error Thrown on failure.
|
||||
*/
|
||||
template<class Fields, class ResponseDecorator>
|
||||
template<class Allocator, class ResponseDecorator>
|
||||
void
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ResponseDecorator const& decorator);
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ResponseDecorator const& decorator);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
|
||||
@ -910,9 +911,9 @@ public:
|
||||
|
||||
@param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
template<class Fields>
|
||||
template<class Allocator>
|
||||
void
|
||||
accept(http::header<true, Fields> const& req,
|
||||
accept(http::header<true, http::basic_fields<Allocator>> const& req,
|
||||
error_code& ec);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
@ -952,11 +953,12 @@ public:
|
||||
|
||||
@param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
template<class Fields, class ResponseDecorator>
|
||||
template<class Allocator, class ResponseDecorator>
|
||||
void
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ResponseDecorator const& decorator,
|
||||
error_code& ec);
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ResponseDecorator const& decorator,
|
||||
error_code& ec);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
|
||||
@ -991,9 +993,9 @@ public:
|
||||
|
||||
@throws system_error Thrown on failure.
|
||||
*/
|
||||
template<class Fields, class ConstBufferSequence>
|
||||
template<class Allocator, class ConstBufferSequence>
|
||||
void
|
||||
accept(http::header<true, Fields> const& req,
|
||||
accept(http::header<true, http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
@ -1038,12 +1040,13 @@ public:
|
||||
|
||||
@throws system_error Thrown on failure.
|
||||
*/
|
||||
template<class Fields, class ConstBufferSequence,
|
||||
template<class Allocator, class ConstBufferSequence,
|
||||
class ResponseDecorator>
|
||||
void
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator);
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
|
||||
@ -1078,9 +1081,9 @@ public:
|
||||
|
||||
@param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
template<class Fields, class ConstBufferSequence>
|
||||
template<class Allocator, class ConstBufferSequence>
|
||||
void
|
||||
accept(http::header<true, Fields> const& req,
|
||||
accept(http::header<true, Allocator> const& req,
|
||||
ConstBufferSequence const& buffers, error_code& ec);
|
||||
|
||||
/** Respond to a WebSocket HTTP Upgrade request
|
||||
@ -1125,13 +1128,14 @@ public:
|
||||
|
||||
@param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
template<class Fields, class ConstBufferSequence,
|
||||
template<class Allocator, class ConstBufferSequence,
|
||||
class ResponseDecorator>
|
||||
void
|
||||
accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
error_code& ec);
|
||||
accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
error_code& ec);
|
||||
|
||||
/** Start reading and responding to a WebSocket HTTP Upgrade request.
|
||||
|
||||
@ -1413,15 +1417,16 @@ public:
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_service::post`.
|
||||
*/
|
||||
template<class Fields, class AcceptHandler>
|
||||
template<class Allocator, class AcceptHandler>
|
||||
#if BEAST_DOXYGEN
|
||||
void_or_deduced
|
||||
#else
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
#endif
|
||||
async_accept(http::header<true, Fields> const& req,
|
||||
AcceptHandler&& handler);
|
||||
async_accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
AcceptHandler&& handler);
|
||||
|
||||
/** Start responding to a WebSocket HTTP Upgrade request.
|
||||
|
||||
@ -1477,7 +1482,7 @@ public:
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_service::post`.
|
||||
*/
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
#if BEAST_DOXYGEN
|
||||
void_or_deduced
|
||||
@ -1485,9 +1490,10 @@ public:
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
#endif
|
||||
async_accept_ex(http::header<true, Fields> const& req,
|
||||
ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler);
|
||||
async_accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler);
|
||||
|
||||
/** Start responding to a WebSocket HTTP Upgrade request.
|
||||
|
||||
@ -1541,7 +1547,7 @@ public:
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_service::post`.
|
||||
*/
|
||||
template<class Fields,
|
||||
template<class Allocator,
|
||||
class ConstBufferSequence, class AcceptHandler>
|
||||
#if BEAST_DOXYGEN
|
||||
void_or_deduced
|
||||
@ -1549,9 +1555,10 @@ public:
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
#endif
|
||||
async_accept(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
AcceptHandler&& handler);
|
||||
async_accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
AcceptHandler&& handler);
|
||||
|
||||
/** Start responding to a WebSocket HTTP Upgrade request.
|
||||
|
||||
@ -1614,7 +1621,7 @@ public:
|
||||
this function. Invocation of the handler will be performed in a
|
||||
manner equivalent to using `boost::asio::io_service::post`.
|
||||
*/
|
||||
template<class Fields, class ConstBufferSequence,
|
||||
template<class Allocator, class ConstBufferSequence,
|
||||
class ResponseDecorator, class AcceptHandler>
|
||||
#if BEAST_DOXYGEN
|
||||
void_or_deduced
|
||||
@ -1622,10 +1629,11 @@ public:
|
||||
async_return_type<
|
||||
AcceptHandler, void(error_code)>
|
||||
#endif
|
||||
async_accept_ex(http::header<true, Fields> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler);
|
||||
async_accept_ex(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
ConstBufferSequence const& buffers,
|
||||
ResponseDecorator const& decorator,
|
||||
AcceptHandler&& handler);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
|
||||
@ -3109,10 +3117,11 @@ private:
|
||||
do_accept(Decorator const& decorator,
|
||||
error_code& ec);
|
||||
|
||||
template<class Fields, class Decorator>
|
||||
template<class Allocator, class Decorator>
|
||||
void
|
||||
do_accept(http::header<true, Fields> const& req,
|
||||
Decorator const& decorator, error_code& ec);
|
||||
do_accept(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
Decorator const& decorator, error_code& ec);
|
||||
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
@ -3129,10 +3138,11 @@ private:
|
||||
string_view target,
|
||||
Decorator const& decorator);
|
||||
|
||||
template<class Fields, class Decorator>
|
||||
template<class Allocator, class Decorator>
|
||||
response_type
|
||||
build_response(http::header<true, Fields> const& req,
|
||||
Decorator const& decorator);
|
||||
build_response(http::header<true,
|
||||
http::basic_fields<Allocator>> const& req,
|
||||
Decorator const& decorator);
|
||||
|
||||
void
|
||||
do_response(http::header<false> const& resp,
|
||||
|
Reference in New Issue
Block a user