Add serializer::chunked

This commit is contained in:
Vinnie Falco
2017-07-07 22:58:10 -07:00
parent c52ddea11d
commit a369f7d9ff
3 changed files with 17 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Version 76:
* Use Boost.Config
* BodyReader may construct from a non-const message
* Add serializer::get
* Add serializer::chunked
--------------------------------------------------------------------------------

View File

@ -87,7 +87,8 @@ next(error_code& ec, Visit&& visit)
frdinit(std::integral_constant<bool,
isRequest>{});
close_ = ! frd_->keep_alive();
if(frd_->chunked())
chunked_ = frd_->chunked();
if(chunked_)
goto go_init_c;
s_ = do_init;
BEAST_FALLTHROUGH;

View File

@ -385,6 +385,17 @@ public:
return s_ == do_complete;
}
/** Return `true` if the serializer will apply chunk-encoding.
This function may only be called if @ref is_header_done
would return `true`.
*/
bool
chunked()
{
return chunked_;
}
/** Return `true` if Connection: close semantic is indicated.
Depending on the contents of the message, the end of
@ -392,6 +403,9 @@ public:
for the recipient (if any) to receive a complete message,
the underlying network connection must be closed when this
function returns `true`.
This function may only be called if @ref is_header_done
would return `true`.
*/
bool
need_close() const