forked from boostorg/beast
Canonicalize string_view parameter types
This commit is contained in:
@@ -3,6 +3,7 @@ Version 49
|
|||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
* Refactor method and verb
|
* Refactor method and verb
|
||||||
|
* Canonicalize string_view parameter types
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -463,8 +463,8 @@ private:
|
|||||||
char const* last, error_code& ec);
|
char const* last, error_code& ec);
|
||||||
|
|
||||||
void
|
void
|
||||||
do_field(string_view const& name,
|
do_field(string_view name,
|
||||||
string_view const& value,
|
string_view value,
|
||||||
error_code& ec);
|
error_code& ec);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -128,7 +128,7 @@ public:
|
|||||||
|
|
||||||
/// Construct a list from a string
|
/// Construct a list from a string
|
||||||
explicit
|
explicit
|
||||||
basic_parsed_list(string_view const& s)
|
basic_parsed_list(string_view s)
|
||||||
: s_(s)
|
: s_(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -211,8 +211,8 @@ protected:
|
|||||||
template<class = void>
|
template<class = void>
|
||||||
static
|
static
|
||||||
bool
|
bool
|
||||||
strieq(string_view const& s1,
|
strieq(string_view s1,
|
||||||
string_view const& s2)
|
string_view s2)
|
||||||
{
|
{
|
||||||
if(s1.size() != s2.size())
|
if(s1.size() != s2.size())
|
||||||
return false;
|
return false;
|
||||||
@@ -227,7 +227,7 @@ protected:
|
|||||||
template<std::size_t N>
|
template<std::size_t N>
|
||||||
bool
|
bool
|
||||||
strieq(const char (&s1)[N],
|
strieq(const char (&s1)[N],
|
||||||
string_view const& s2)
|
string_view s2)
|
||||||
{
|
{
|
||||||
return strieq({s1, N-1}, s2);
|
return strieq({s1, N-1}, s2);
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,8 @@ public:
|
|||||||
std::string first;
|
std::string first;
|
||||||
std::string second;
|
std::string second;
|
||||||
|
|
||||||
value_type(string_view const& name_,
|
value_type(string_view name_,
|
||||||
string_view const& value_)
|
string_view value_)
|
||||||
: first(name_)
|
: first(name_)
|
||||||
, second(value_)
|
, second(value_)
|
||||||
{
|
{
|
||||||
@@ -63,8 +63,8 @@ protected:
|
|||||||
{
|
{
|
||||||
value_type data;
|
value_type data;
|
||||||
|
|
||||||
element(string_view const& name,
|
element(string_view name,
|
||||||
string_view const& value)
|
string_view value)
|
||||||
: data(name, value)
|
: data(name, value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -329,7 +329,7 @@ skip_token(FwdIt& it, FwdIt const& last)
|
|||||||
|
|
||||||
inline
|
inline
|
||||||
string_view
|
string_view
|
||||||
trim(string_view const& s)
|
trim(string_view s)
|
||||||
{
|
{
|
||||||
auto first = s.begin();
|
auto first = s.begin();
|
||||||
auto last = s.end();
|
auto last = s.end();
|
||||||
@@ -459,7 +459,7 @@ struct opt_token_list_policy
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
operator()(value_type& v,
|
operator()(value_type& v,
|
||||||
char const*& it, string_view const& s) const
|
char const*& it, string_view s) const
|
||||||
{
|
{
|
||||||
v = {};
|
v = {};
|
||||||
auto need_comma = it != s.begin();
|
auto need_comma = it != s.begin();
|
||||||
|
@@ -177,14 +177,14 @@ public:
|
|||||||
|
|
||||||
/// Returns `true` if the specified field exists.
|
/// Returns `true` if the specified field exists.
|
||||||
bool
|
bool
|
||||||
exists(string_view const& name) const
|
exists(string_view name) const
|
||||||
{
|
{
|
||||||
return set_.find(name, less{}) != set_.end();
|
return set_.find(name, less{}) != set_.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the number of values for the specified field.
|
/// Returns the number of values for the specified field.
|
||||||
std::size_t
|
std::size_t
|
||||||
count(string_view const& name) const;
|
count(string_view name) const;
|
||||||
|
|
||||||
/** Returns an iterator to the case-insensitive matching field name.
|
/** Returns an iterator to the case-insensitive matching field name.
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ public:
|
|||||||
first field defined by insertion order is returned.
|
first field defined by insertion order is returned.
|
||||||
*/
|
*/
|
||||||
iterator
|
iterator
|
||||||
find(string_view const& name) const;
|
find(string_view name) const;
|
||||||
|
|
||||||
/** Returns the value for a case-insensitive matching header, or `""`.
|
/** Returns the value for a case-insensitive matching header, or `""`.
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ public:
|
|||||||
first field defined by insertion order is returned.
|
first field defined by insertion order is returned.
|
||||||
*/
|
*/
|
||||||
string_view const
|
string_view const
|
||||||
operator[](string_view const& name) const;
|
operator[](string_view name) const;
|
||||||
|
|
||||||
/// Clear the contents of the basic_fields.
|
/// Clear the contents of the basic_fields.
|
||||||
void
|
void
|
||||||
@@ -216,7 +216,7 @@ public:
|
|||||||
@return The number of fields removed.
|
@return The number of fields removed.
|
||||||
*/
|
*/
|
||||||
std::size_t
|
std::size_t
|
||||||
erase(string_view const& name);
|
erase(string_view name);
|
||||||
|
|
||||||
/** Insert a field value.
|
/** Insert a field value.
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ public:
|
|||||||
@param value A string holding the value of the field.
|
@param value A string holding the value of the field.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
insert(string_view const& name, string_view value);
|
insert(string_view name, string_view value);
|
||||||
|
|
||||||
/** Insert a field value.
|
/** Insert a field value.
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ public:
|
|||||||
@param value A string holding the value of the field.
|
@param value A string holding the value of the field.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
replace(string_view const& name, string_view value);
|
replace(string_view name, string_view value);
|
||||||
|
|
||||||
/** Replace a field value.
|
/** Replace a field value.
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ public:
|
|||||||
template<class T>
|
template<class T>
|
||||||
typename std::enable_if<
|
typename std::enable_if<
|
||||||
! std::is_constructible<string_view, T>::value>::type
|
! std::is_constructible<string_view, T>::value>::type
|
||||||
replace(string_view const& name, T const& value)
|
replace(string_view name, T const& value)
|
||||||
{
|
{
|
||||||
replace(name,
|
replace(name,
|
||||||
boost::lexical_cast<std::string>(value));
|
boost::lexical_cast<std::string>(value));
|
||||||
|
@@ -739,8 +739,8 @@ template<bool isRequest, class Derived>
|
|||||||
void
|
void
|
||||||
basic_parser<isRequest, Derived>::
|
basic_parser<isRequest, Derived>::
|
||||||
do_field(
|
do_field(
|
||||||
string_view const& name,
|
string_view name,
|
||||||
string_view const& value,
|
string_view value,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
// Connection
|
// Connection
|
||||||
|
@@ -161,7 +161,7 @@ operator=(basic_fields<OtherAlloc> const& other) ->
|
|||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
std::size_t
|
std::size_t
|
||||||
basic_fields<Allocator>::
|
basic_fields<Allocator>::
|
||||||
count(string_view const& name) const
|
count(string_view name) const
|
||||||
{
|
{
|
||||||
auto const it = set_.find(name, less{});
|
auto const it = set_.find(name, less{});
|
||||||
if(it == set_.end())
|
if(it == set_.end())
|
||||||
@@ -173,7 +173,7 @@ count(string_view const& name) const
|
|||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
auto
|
auto
|
||||||
basic_fields<Allocator>::
|
basic_fields<Allocator>::
|
||||||
find(string_view const& name) const ->
|
find(string_view name) const ->
|
||||||
iterator
|
iterator
|
||||||
{
|
{
|
||||||
auto const it = set_.find(name, less{});
|
auto const it = set_.find(name, less{});
|
||||||
@@ -185,7 +185,7 @@ find(string_view const& name) const ->
|
|||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
string_view const
|
string_view const
|
||||||
basic_fields<Allocator>::
|
basic_fields<Allocator>::
|
||||||
operator[](string_view const& name) const
|
operator[](string_view name) const
|
||||||
{
|
{
|
||||||
auto const it = find(name);
|
auto const it = find(name);
|
||||||
if(it == end())
|
if(it == end())
|
||||||
@@ -206,7 +206,7 @@ clear() noexcept
|
|||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
std::size_t
|
std::size_t
|
||||||
basic_fields<Allocator>::
|
basic_fields<Allocator>::
|
||||||
erase(string_view const& name)
|
erase(string_view name)
|
||||||
{
|
{
|
||||||
auto it = set_.find(name, less{});
|
auto it = set_.find(name, less{});
|
||||||
if(it == set_.end())
|
if(it == set_.end())
|
||||||
@@ -230,7 +230,7 @@ erase(string_view const& name)
|
|||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
void
|
void
|
||||||
basic_fields<Allocator>::
|
basic_fields<Allocator>::
|
||||||
insert(string_view const& name,
|
insert(string_view name,
|
||||||
string_view value)
|
string_view value)
|
||||||
{
|
{
|
||||||
value = detail::trim(value);
|
value = detail::trim(value);
|
||||||
@@ -243,7 +243,7 @@ insert(string_view const& name,
|
|||||||
template<class Allocator>
|
template<class Allocator>
|
||||||
void
|
void
|
||||||
basic_fields<Allocator>::
|
basic_fields<Allocator>::
|
||||||
replace(string_view const& name,
|
replace(string_view name,
|
||||||
string_view value)
|
string_view value)
|
||||||
{
|
{
|
||||||
value = detail::trim(value);
|
value = detail::trim(value);
|
||||||
|
@@ -87,7 +87,7 @@ private:
|
|||||||
template<class = void>
|
template<class = void>
|
||||||
static
|
static
|
||||||
std::string
|
std::string
|
||||||
unquote(string_view const& sr);
|
unquote(string_view sr);
|
||||||
|
|
||||||
template<class = void>
|
template<class = void>
|
||||||
void
|
void
|
||||||
@@ -133,7 +133,7 @@ cend() const ->
|
|||||||
template<class>
|
template<class>
|
||||||
std::string
|
std::string
|
||||||
param_list::const_iterator::
|
param_list::const_iterator::
|
||||||
unquote(string_view const& sr)
|
unquote(string_view sr)
|
||||||
{
|
{
|
||||||
std::string s;
|
std::string s;
|
||||||
s.reserve(sr.size());
|
s.reserve(sr.size());
|
||||||
|
@@ -187,7 +187,7 @@ private:
|
|||||||
|
|
||||||
void
|
void
|
||||||
on_chunk(std::uint64_t,
|
on_chunk(std::uint64_t,
|
||||||
string_view const&, error_code&)
|
string_view, error_code&)
|
||||||
{
|
{
|
||||||
body_ = {};
|
body_ = {};
|
||||||
}
|
}
|
||||||
@@ -331,8 +331,8 @@ private:
|
|||||||
|
|
||||||
void
|
void
|
||||||
on_request(
|
on_request(
|
||||||
string_view const& method,
|
string_view method,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
int version, error_code&)
|
int version, error_code&)
|
||||||
{
|
{
|
||||||
m_.target(target);
|
m_.target(target);
|
||||||
@@ -342,7 +342,7 @@ private:
|
|||||||
|
|
||||||
void
|
void
|
||||||
on_response(int status,
|
on_response(int status,
|
||||||
string_view const& reason,
|
string_view reason,
|
||||||
int version, error_code&)
|
int version, error_code&)
|
||||||
{
|
{
|
||||||
m_.status = status;
|
m_.status = status;
|
||||||
@@ -351,8 +351,8 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_field(string_view const& name,
|
on_field(string_view name,
|
||||||
string_view const& value,
|
string_view value,
|
||||||
error_code&)
|
error_code&)
|
||||||
{
|
{
|
||||||
m_.fields.insert(name, value);
|
m_.fields.insert(name, value);
|
||||||
@@ -373,7 +373,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_data(string_view const& s,
|
on_data(string_view s,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
wr_->put(boost::asio::buffer(
|
wr_->put(boost::asio::buffer(
|
||||||
@@ -382,7 +382,7 @@ private:
|
|||||||
|
|
||||||
void
|
void
|
||||||
on_chunk(
|
on_chunk(
|
||||||
std::uint64_t, string_view const&,
|
std::uint64_t, string_view,
|
||||||
error_code&)
|
error_code&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -77,7 +77,7 @@ public:
|
|||||||
must remain valid for the lifetime of the container.
|
must remain valid for the lifetime of the container.
|
||||||
*/
|
*/
|
||||||
explicit
|
explicit
|
||||||
param_list(string_view const& s)
|
param_list(string_view s)
|
||||||
: s_(s)
|
: s_(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ public:
|
|||||||
must remain valid for the lifetime of the container.
|
must remain valid for the lifetime of the container.
|
||||||
*/
|
*/
|
||||||
explicit
|
explicit
|
||||||
ext_list(string_view const& s)
|
ext_list(string_view s)
|
||||||
: s_(s)
|
: s_(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -251,7 +251,7 @@ public:
|
|||||||
must remain valid for the lifetime of the container.
|
must remain valid for the lifetime of the container.
|
||||||
*/
|
*/
|
||||||
explicit
|
explicit
|
||||||
token_list(string_view const& s)
|
token_list(string_view s)
|
||||||
: s_(s)
|
: s_(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -47,7 +47,7 @@ struct pmd_offer
|
|||||||
|
|
||||||
template<class = void>
|
template<class = void>
|
||||||
int
|
int
|
||||||
parse_bits(string_view const& s)
|
parse_bits(string_view s)
|
||||||
{
|
{
|
||||||
if(s.size() == 0)
|
if(s.size() == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -47,8 +47,8 @@ class stream<NextLayer>::handshake_op
|
|||||||
template<class Decorator>
|
template<class Decorator>
|
||||||
data(Handler& handler, stream<NextLayer>& ws_,
|
data(Handler& handler, stream<NextLayer>& ws_,
|
||||||
response_type* res_p_,
|
response_type* res_p_,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
Decorator const& decorator)
|
Decorator const& decorator)
|
||||||
: ws(ws_)
|
: ws(ws_)
|
||||||
, res_p(res_p_)
|
, res_p(res_p_)
|
||||||
@@ -171,8 +171,8 @@ template<class HandshakeHandler>
|
|||||||
async_return_type<
|
async_return_type<
|
||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
async_handshake(string_view const& host,
|
async_handshake(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
HandshakeHandler&& handler)
|
HandshakeHandler&& handler)
|
||||||
{
|
{
|
||||||
static_assert(is_async_stream<next_layer_type>::value,
|
static_assert(is_async_stream<next_layer_type>::value,
|
||||||
@@ -192,8 +192,8 @@ async_return_type<
|
|||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
async_handshake(response_type& res,
|
async_handshake(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
HandshakeHandler&& handler)
|
HandshakeHandler&& handler)
|
||||||
{
|
{
|
||||||
static_assert(is_async_stream<next_layer_type>::value,
|
static_assert(is_async_stream<next_layer_type>::value,
|
||||||
@@ -212,8 +212,8 @@ template<class RequestDecorator, class HandshakeHandler>
|
|||||||
async_return_type<
|
async_return_type<
|
||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
async_handshake_ex(string_view const& host,
|
async_handshake_ex(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
HandshakeHandler&& handler)
|
HandshakeHandler&& handler)
|
||||||
{
|
{
|
||||||
@@ -237,8 +237,8 @@ async_return_type<
|
|||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
async_handshake_ex(response_type& res,
|
async_handshake_ex(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
HandshakeHandler&& handler)
|
HandshakeHandler&& handler)
|
||||||
{
|
{
|
||||||
@@ -259,8 +259,8 @@ async_handshake_ex(response_type& res,
|
|||||||
template<class NextLayer>
|
template<class NextLayer>
|
||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake(string_view const& host,
|
handshake(string_view host,
|
||||||
string_view const& target)
|
string_view target)
|
||||||
{
|
{
|
||||||
static_assert(is_sync_stream<next_layer_type>::value,
|
static_assert(is_sync_stream<next_layer_type>::value,
|
||||||
"SyncStream requirements not met");
|
"SyncStream requirements not met");
|
||||||
@@ -275,8 +275,8 @@ template<class NextLayer>
|
|||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake(response_type& res,
|
handshake(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target)
|
string_view target)
|
||||||
{
|
{
|
||||||
static_assert(is_sync_stream<next_layer_type>::value,
|
static_assert(is_sync_stream<next_layer_type>::value,
|
||||||
"SyncStream requirements not met");
|
"SyncStream requirements not met");
|
||||||
@@ -290,8 +290,8 @@ template<class NextLayer>
|
|||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake_ex(string_view const& host,
|
handshake_ex(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator)
|
RequestDecorator const& decorator)
|
||||||
{
|
{
|
||||||
static_assert(is_sync_stream<next_layer_type>::value,
|
static_assert(is_sync_stream<next_layer_type>::value,
|
||||||
@@ -310,8 +310,8 @@ template<class RequestDecorator>
|
|||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake_ex(response_type& res,
|
handshake_ex(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator)
|
RequestDecorator const& decorator)
|
||||||
{
|
{
|
||||||
static_assert(is_sync_stream<next_layer_type>::value,
|
static_assert(is_sync_stream<next_layer_type>::value,
|
||||||
@@ -328,8 +328,8 @@ handshake_ex(response_type& res,
|
|||||||
template<class NextLayer>
|
template<class NextLayer>
|
||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake(string_view const& host,
|
handshake(string_view host,
|
||||||
string_view const& target, error_code& ec)
|
string_view target, error_code& ec)
|
||||||
{
|
{
|
||||||
static_assert(is_sync_stream<next_layer_type>::value,
|
static_assert(is_sync_stream<next_layer_type>::value,
|
||||||
"SyncStream requirements not met");
|
"SyncStream requirements not met");
|
||||||
@@ -341,8 +341,8 @@ template<class NextLayer>
|
|||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake(response_type& res,
|
handshake(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
static_assert(is_sync_stream<next_layer_type>::value,
|
static_assert(is_sync_stream<next_layer_type>::value,
|
||||||
@@ -355,8 +355,8 @@ template<class NextLayer>
|
|||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake_ex(string_view const& host,
|
handshake_ex(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
@@ -374,8 +374,8 @@ template<class RequestDecorator>
|
|||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
handshake_ex(response_type& res,
|
handshake_ex(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
|
@@ -128,8 +128,8 @@ template<class RequestDecorator>
|
|||||||
void
|
void
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
do_handshake(response_type* res_p,
|
do_handshake(response_type* res_p,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
@@ -157,8 +157,8 @@ template<class Decorator>
|
|||||||
request_type
|
request_type
|
||||||
stream<NextLayer>::
|
stream<NextLayer>::
|
||||||
build_request(detail::sec_ws_key_type& key,
|
build_request(detail::sec_ws_key_type& key,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
Decorator const& decorator)
|
Decorator const& decorator)
|
||||||
{
|
{
|
||||||
request_type req;
|
request_type req;
|
||||||
|
@@ -1471,8 +1471,8 @@ public:
|
|||||||
@endcode
|
@endcode
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handshake(string_view const& host,
|
handshake(string_view host,
|
||||||
string_view const& target);
|
string_view target);
|
||||||
|
|
||||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||||
|
|
||||||
@@ -1519,8 +1519,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handshake(response_type& res,
|
handshake(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target);
|
string_view target);
|
||||||
|
|
||||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||||
|
|
||||||
@@ -1576,8 +1576,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
handshake_ex(string_view const& host,
|
handshake_ex(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator);
|
RequestDecorator const& decorator);
|
||||||
|
|
||||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||||
@@ -1639,8 +1639,8 @@ public:
|
|||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
handshake_ex(response_type& res,
|
handshake_ex(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator);
|
RequestDecorator const& decorator);
|
||||||
|
|
||||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||||
@@ -1681,8 +1681,8 @@ public:
|
|||||||
@endcode
|
@endcode
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handshake(string_view const& host,
|
handshake(string_view host,
|
||||||
string_view const& target, error_code& ec);
|
string_view target, error_code& ec);
|
||||||
|
|
||||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||||
|
|
||||||
@@ -1727,8 +1727,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
handshake(response_type& res,
|
handshake(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
error_code& ec);
|
error_code& ec);
|
||||||
|
|
||||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||||
@@ -1784,8 +1784,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
handshake_ex(string_view const& host,
|
handshake_ex(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
error_code& ec);
|
error_code& ec);
|
||||||
|
|
||||||
@@ -1847,8 +1847,8 @@ public:
|
|||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
handshake_ex(response_type& res,
|
handshake_ex(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
error_code& ec);
|
error_code& ec);
|
||||||
|
|
||||||
@@ -1899,8 +1899,8 @@ public:
|
|||||||
async_return_type<
|
async_return_type<
|
||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
#endif
|
#endif
|
||||||
async_handshake(string_view const& host,
|
async_handshake(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
HandshakeHandler&& handler);
|
HandshakeHandler&& handler);
|
||||||
|
|
||||||
/** Start an asynchronous operation to send an upgrade request and receive the response.
|
/** Start an asynchronous operation to send an upgrade request and receive the response.
|
||||||
@@ -1955,8 +1955,8 @@ public:
|
|||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
#endif
|
#endif
|
||||||
async_handshake(response_type& res,
|
async_handshake(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
HandshakeHandler&& handler);
|
HandshakeHandler&& handler);
|
||||||
|
|
||||||
/** Start an asynchronous operation to send an upgrade request and receive the response.
|
/** Start an asynchronous operation to send an upgrade request and receive the response.
|
||||||
@@ -2015,8 +2015,8 @@ public:
|
|||||||
async_return_type<
|
async_return_type<
|
||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
#endif
|
#endif
|
||||||
async_handshake_ex(string_view const& host,
|
async_handshake_ex(string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
HandshakeHandler&& handler);
|
HandshakeHandler&& handler);
|
||||||
|
|
||||||
@@ -2081,8 +2081,8 @@ public:
|
|||||||
HandshakeHandler, void(error_code)>
|
HandshakeHandler, void(error_code)>
|
||||||
#endif
|
#endif
|
||||||
async_handshake_ex(response_type& res,
|
async_handshake_ex(response_type& res,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
HandshakeHandler&& handler);
|
HandshakeHandler&& handler);
|
||||||
|
|
||||||
@@ -2963,16 +2963,16 @@ private:
|
|||||||
template<class RequestDecorator>
|
template<class RequestDecorator>
|
||||||
void
|
void
|
||||||
do_handshake(response_type* res_p,
|
do_handshake(response_type* res_p,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
RequestDecorator const& decorator,
|
RequestDecorator const& decorator,
|
||||||
error_code& ec);
|
error_code& ec);
|
||||||
|
|
||||||
template<class Decorator>
|
template<class Decorator>
|
||||||
request_type
|
request_type
|
||||||
build_request(detail::sec_ws_key_type& key,
|
build_request(detail::sec_ws_key_type& key,
|
||||||
string_view const& host,
|
string_view host,
|
||||||
string_view const& target,
|
string_view target,
|
||||||
Decorator const& decorator);
|
Decorator const& decorator);
|
||||||
|
|
||||||
template<class Fields, class Decorator>
|
template<class Fields, class Decorator>
|
||||||
|
@@ -217,7 +217,7 @@ public:
|
|||||||
|
|
||||||
template<bool isRequest, class Pred>
|
template<bool isRequest, class Pred>
|
||||||
void
|
void
|
||||||
good(string_view const& s,
|
good(string_view s,
|
||||||
Pred const& pred, bool skipBody = false)
|
Pred const& pred, bool skipBody = false)
|
||||||
{
|
{
|
||||||
using boost::asio::buffer;
|
using boost::asio::buffer;
|
||||||
@@ -239,7 +239,7 @@ public:
|
|||||||
|
|
||||||
template<bool isRequest>
|
template<bool isRequest>
|
||||||
void
|
void
|
||||||
good(string_view const& s)
|
good(string_view s)
|
||||||
{
|
{
|
||||||
good<isRequest>(s,
|
good<isRequest>(s,
|
||||||
[](test_parser<isRequest> const&)
|
[](test_parser<isRequest> const&)
|
||||||
@@ -249,7 +249,7 @@ public:
|
|||||||
|
|
||||||
template<bool isRequest>
|
template<bool isRequest>
|
||||||
void
|
void
|
||||||
bad(string_view const& s,
|
bad(string_view s,
|
||||||
error_code const& ev, bool skipBody = false)
|
error_code const& ev, bool skipBody = false)
|
||||||
{
|
{
|
||||||
using boost::asio::buffer;
|
using boost::asio::buffer;
|
||||||
|
@@ -19,7 +19,7 @@ namespace http {
|
|||||||
|
|
||||||
template<class = void>
|
template<class = void>
|
||||||
std::string
|
std::string
|
||||||
escaped_string(string_view const& s)
|
escaped_string(string_view s)
|
||||||
{
|
{
|
||||||
std::string out;
|
std::string out;
|
||||||
out.reserve(s.size());
|
out.reserve(s.size());
|
||||||
|
@@ -165,22 +165,22 @@ public:
|
|||||||
boost::asio::mutable_buffers_1;
|
boost::asio::mutable_buffers_1;
|
||||||
|
|
||||||
void
|
void
|
||||||
on_request(string_view const&,
|
on_request(string_view,
|
||||||
string_view const&,
|
string_view,
|
||||||
int, error_code&)
|
int, error_code&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_response(int,
|
on_response(int,
|
||||||
string_view const&,
|
string_view,
|
||||||
int, error_code&)
|
int, error_code&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_field(string_view const&,
|
on_field(string_view,
|
||||||
string_view const&,
|
string_view,
|
||||||
error_code&)
|
error_code&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -197,14 +197,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_data(string_view const&,
|
on_data(string_view,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_chunk(std::uint64_t,
|
on_chunk(std::uint64_t,
|
||||||
string_view const&,
|
string_view,
|
||||||
error_code&)
|
error_code&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ public:
|
|||||||
|
|
||||||
static
|
static
|
||||||
std::string
|
std::string
|
||||||
str(string_view const& s)
|
str(string_view s)
|
||||||
{
|
{
|
||||||
return std::string(s.data(), s.size());
|
return std::string(s.data(), s.size());
|
||||||
}
|
}
|
||||||
@@ -241,7 +241,7 @@ public:
|
|||||||
template<class Policy>
|
template<class Policy>
|
||||||
static
|
static
|
||||||
std::vector<std::string>
|
std::vector<std::string>
|
||||||
to_vector(string_view const& in)
|
to_vector(string_view in)
|
||||||
{
|
{
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
detail::basic_parsed_list<Policy> list{in};
|
detail::basic_parsed_list<Policy> list{in};
|
||||||
@@ -253,7 +253,7 @@ public:
|
|||||||
|
|
||||||
template<class Policy>
|
template<class Policy>
|
||||||
void
|
void
|
||||||
validate(string_view const& in,
|
validate(string_view in,
|
||||||
std::vector<std::string> const& v)
|
std::vector<std::string> const& v)
|
||||||
{
|
{
|
||||||
BEAST_EXPECT(to_vector<Policy>(in) == v);
|
BEAST_EXPECT(to_vector<Policy>(in) == v);
|
||||||
@@ -261,7 +261,7 @@ public:
|
|||||||
|
|
||||||
template<class Policy>
|
template<class Policy>
|
||||||
void
|
void
|
||||||
good(string_view const& in)
|
good(string_view in)
|
||||||
{
|
{
|
||||||
BEAST_EXPECT(validate_list(
|
BEAST_EXPECT(validate_list(
|
||||||
detail::basic_parsed_list<Policy>{in}));
|
detail::basic_parsed_list<Policy>{in}));
|
||||||
@@ -269,7 +269,7 @@ public:
|
|||||||
|
|
||||||
template<class Policy>
|
template<class Policy>
|
||||||
void
|
void
|
||||||
good(string_view const& in,
|
good(string_view in,
|
||||||
std::vector<std::string> const& v)
|
std::vector<std::string> const& v)
|
||||||
{
|
{
|
||||||
BEAST_EXPECT(validate_list(
|
BEAST_EXPECT(validate_list(
|
||||||
@@ -279,7 +279,7 @@ public:
|
|||||||
|
|
||||||
template<class Policy>
|
template<class Policy>
|
||||||
void
|
void
|
||||||
bad(string_view const& in)
|
bad(string_view in)
|
||||||
{
|
{
|
||||||
BEAST_EXPECT(! validate_list(
|
BEAST_EXPECT(! validate_list(
|
||||||
detail::basic_parsed_list<Policy>{in}));
|
detail::basic_parsed_list<Policy>{in}));
|
||||||
|
@@ -47,8 +47,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_request(string_view const& method_,
|
on_request(string_view method_,
|
||||||
string_view const& path_,
|
string_view path_,
|
||||||
int version_, error_code& ec)
|
int version_, error_code& ec)
|
||||||
{
|
{
|
||||||
method = std::string(
|
method = std::string(
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
void
|
void
|
||||||
on_response(int status_,
|
on_response(int status_,
|
||||||
string_view const& reason_,
|
string_view reason_,
|
||||||
int version_, error_code& ec)
|
int version_, error_code& ec)
|
||||||
{
|
{
|
||||||
status = status_;
|
status = status_;
|
||||||
@@ -76,8 +76,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_field(string_view const&,
|
on_field(string_view,
|
||||||
string_view const&,
|
string_view,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
got_on_field = true;
|
got_on_field = true;
|
||||||
@@ -106,7 +106,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
on_data(string_view const& s,
|
on_data(string_view s,
|
||||||
error_code& ec)
|
error_code& ec)
|
||||||
{
|
{
|
||||||
body.append(s.data(), s.size());
|
body.append(s.data(), s.size());
|
||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
|
|
||||||
void
|
void
|
||||||
on_chunk(std::uint64_t,
|
on_chunk(std::uint64_t,
|
||||||
string_view const&, error_code& ec)
|
string_view, error_code& ec)
|
||||||
{
|
{
|
||||||
got_on_chunk = true;
|
got_on_chunk = true;
|
||||||
if(fc_)
|
if(fc_)
|
||||||
|
@@ -200,8 +200,8 @@ public:
|
|||||||
template<class NextLayer>
|
template<class NextLayer>
|
||||||
void
|
void
|
||||||
handshake(stream<NextLayer>& ws,
|
handshake(stream<NextLayer>& ws,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path) const
|
string_view path) const
|
||||||
{
|
{
|
||||||
ws.handshake(uri, path);
|
ws.handshake(uri, path);
|
||||||
}
|
}
|
||||||
@@ -210,8 +210,8 @@ public:
|
|||||||
void
|
void
|
||||||
handshake(stream<NextLayer>& ws,
|
handshake(stream<NextLayer>& ws,
|
||||||
response_type& res,
|
response_type& res,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path) const
|
string_view path) const
|
||||||
{
|
{
|
||||||
ws.handshake(res, uri, path);
|
ws.handshake(res, uri, path);
|
||||||
}
|
}
|
||||||
@@ -219,8 +219,8 @@ public:
|
|||||||
template<class NextLayer, class Decorator>
|
template<class NextLayer, class Decorator>
|
||||||
void
|
void
|
||||||
handshake_ex(stream<NextLayer>& ws,
|
handshake_ex(stream<NextLayer>& ws,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path,
|
string_view path,
|
||||||
Decorator const& d) const
|
Decorator const& d) const
|
||||||
{
|
{
|
||||||
ws.handshake_ex(uri, path, d);
|
ws.handshake_ex(uri, path, d);
|
||||||
@@ -230,8 +230,8 @@ public:
|
|||||||
void
|
void
|
||||||
handshake_ex(stream<NextLayer>& ws,
|
handshake_ex(stream<NextLayer>& ws,
|
||||||
response_type& res,
|
response_type& res,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path,
|
string_view path,
|
||||||
Decorator const& d) const
|
Decorator const& d) const
|
||||||
{
|
{
|
||||||
ws.handshake_ex(res, uri, path, d);
|
ws.handshake_ex(res, uri, path, d);
|
||||||
@@ -413,8 +413,8 @@ public:
|
|||||||
template<class NextLayer>
|
template<class NextLayer>
|
||||||
void
|
void
|
||||||
handshake(stream<NextLayer>& ws,
|
handshake(stream<NextLayer>& ws,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path) const
|
string_view path) const
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
ws.async_handshake(
|
ws.async_handshake(
|
||||||
@@ -427,8 +427,8 @@ public:
|
|||||||
void
|
void
|
||||||
handshake(stream<NextLayer>& ws,
|
handshake(stream<NextLayer>& ws,
|
||||||
response_type& res,
|
response_type& res,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path) const
|
string_view path) const
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
ws.async_handshake(
|
ws.async_handshake(
|
||||||
@@ -440,8 +440,8 @@ public:
|
|||||||
template<class NextLayer, class Decorator>
|
template<class NextLayer, class Decorator>
|
||||||
void
|
void
|
||||||
handshake_ex(stream<NextLayer>& ws,
|
handshake_ex(stream<NextLayer>& ws,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path,
|
string_view path,
|
||||||
Decorator const &d) const
|
Decorator const &d) const
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
@@ -455,8 +455,8 @@ public:
|
|||||||
void
|
void
|
||||||
handshake_ex(stream<NextLayer>& ws,
|
handshake_ex(stream<NextLayer>& ws,
|
||||||
response_type& res,
|
response_type& res,
|
||||||
string_view const& uri,
|
string_view uri,
|
||||||
string_view const& path,
|
string_view path,
|
||||||
Decorator const &d) const
|
Decorator const &d) const
|
||||||
{
|
{
|
||||||
error_code ec;
|
error_code ec;
|
||||||
|
Reference in New Issue
Block a user