Rename to serializer::keep_alive (API Change):

The serializer member is renamed to keep_alive()

Actions Required:

* Use serializer::keep_alive instead of serializer::close and
  take the logical NOT of the return value.
This commit is contained in:
Vinnie Falco
2017-07-07 23:05:11 -07:00
parent a369f7d9ff
commit 83403570bd
4 changed files with 30 additions and 14 deletions

View File

@ -6,6 +6,15 @@ Version 76:
* Add serializer::get
* Add serializer::chunked
API Changes:
* Rename to serializer::keep_alive
Actions Required:
* Use serializer::keep_alive instead of serializer::close and
take the logical NOT of the return value.
--------------------------------------------------------------------------------
Version 75:

View File

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

View File

@ -163,7 +163,7 @@ operator()(
{
sr_.consume(bytes_transferred);
if(sr_.is_done())
if(sr_.need_close())
if(! sr_.keep_alive())
ec = error::end_of_stream;
}
h_(ec);
@ -480,11 +480,11 @@ write_some(
if(f.invoked)
sr.consume(f.bytes_transferred);
if(sr.is_done())
if(sr.need_close())
if(! sr.keep_alive())
ec = error::end_of_stream;
return;
}
if(sr.need_close())
if(! sr.keep_alive())
ec = error::end_of_stream;
else
ec.assign(0, ec.category());

View File

@ -67,7 +67,7 @@ struct no_chunk_decorator
if the contents of the message indicate that chunk encoding
is required. If the semantics of the message indicate that
the connection should be closed after the message is sent, the
function @ref need_close will return `true`.
function @ref keep_alive will return `true`.
Upon construction, an optional chunk decorator may be
specified. This decorator is a function object called with
@ -268,7 +268,7 @@ private:
bool split_ = false;
bool header_done_ = false;
bool chunked_;
bool close_;
bool keep_alive_;
bool more_;
ChunkDecorator d_;
@ -396,21 +396,28 @@ public:
return chunked_;
}
/** Return `true` if Connection: close semantic is indicated.
/** Return `true` if Connection: keep-alive semantic is indicated.
Depending on the contents of the message, the end of
the body may be indicated by the end of file. In order
for the recipient (if any) to receive a complete message,
the underlying network connection must be closed when this
function returns `true`.
This function returns `true` if the semantics of the
message indicate that the connection should be kept open
after the serialized message has been transmitted. The
value depends on the HTTP version of the message,
the tokens in the Connection header, and the metadata
describing the payload body.
Depending on the payload body, the end of the message may
be indicated by connection closuire. In order for the
recipient (if any) to receive a complete message, the
underlying stream or network connection must be closed
when this function returns `false`.
This function may only be called if @ref is_header_done
would return `true`.
*/
bool
need_close() const
keep_alive()
{
return close_;
return keep_alive_;
}
/** Returns the next set of buffers in the serialization.