Add message::header_part()

This commit is contained in:
Vinnie Falco
2017-06-17 15:43:55 -07:00
parent 30e6426db5
commit 8c3cc96a27
3 changed files with 17 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Version 61:
* Use generic_cateogry for errno
* Reorganize SSL examples
* Tidy up some integer conversion warnings
* Add message::header_part()
--------------------------------------------------------------------------------

View File

@ -300,8 +300,7 @@ void
message<isRequest, Body, Fields>::
prepare()
{
prepare(typename header<
isRequest, Fields>::is_request{});
prepare(typename header_type::is_request{});
}
template<bool isRequest, class Body, class Fields>

View File

@ -322,7 +322,7 @@ struct header<false, Fields> : Fields
*/
void
reason(string_view s);
private:
#if ! BEAST_DOXYGEN
template<bool, class, class>
@ -469,6 +469,20 @@ struct message : header<isRequest, Fields>
std::tuple<BodyArgs...>&& body_args,
std::tuple<HeaderArgs...>&& header_args);
/// Returns the header portion of the message
header_type const&
header_part() const
{
return *this;
}
/// Returns the header portion of the message
header_type&
header_part()
{
return *this;
}
/// Returns `true` if "close" is specified in the Connection field.
bool
has_close() const;