Add message keep_alive, chunked, content_length members

This commit is contained in:
Vinnie Falco
2017-07-20 08:15:30 -07:00
parent aa473a6da4
commit 6a46e48424
15 changed files with 1025 additions and 325 deletions
+52 -28
View File
@@ -190,52 +190,76 @@ public:
struct reader;
protected:
/** Set or clear the method string.
@note Only called for requests.
*/
void set_method_impl(string_view s);
/** Set or clear the target string.
@note Only called for requests.
*/
void set_target_impl(string_view s);
/** Set or clear the reason string.
@note Only called for responses.
*/
void set_reason_impl(string_view s);
/** Returns the request-method string.
@note Only called for requests.
*/
string_view get_method_impl() const;
string_view
get_method_impl() const;
/** Returns the request-target string.
@note Only called for requests.
*/
string_view get_target_impl() const;
string_view
get_target_impl() const;
/** Returns the response reason-phrase string.
@note Only called for responses.
*/
string_view get_reason_impl() const;
string_view
get_reason_impl() const;
/** Updates the payload metadata.
@param b `true` if chunked
@param n The content length if known, otherwise `boost::none`
/** Returns the chunked Transfer-Encoding setting
*/
void prepare_payload_impl(bool b, boost::optional<std::uint64_t> n);
bool
get_chunked_impl() const;
/** Returns the keep-alive setting
*/
bool
get_keep_alive_impl(unsigned version) const;
/** Set or clear the method string.
@note Only called for requests.
*/
void
set_method_impl(string_view s);
/** Set or clear the target string.
@note Only called for requests.
*/
void
set_target_impl(string_view s);
/** Set or clear the reason string.
@note Only called for responses.
*/
void
set_reason_impl(string_view s);
/** Sets or clears the chunked Transfer-Encoding value
*/
void
set_chunked_impl(bool value);
/** Sets or clears the Content-Length field
*/
void
set_content_length_impl(boost::optional<std::uint64_t>);
/** Adjusts the Connection field
*/
void
set_keep_alive_impl(unsigned version, bool keep_alive);
};
static_assert(is_fields<Fields>::value, "");
static_assert(is_fields<Fields>::value,
"Fields requirements not met");
//]