mirror of
https://github.com/boostorg/beast.git
synced 2025-08-01 22:04:34 +02:00
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:
@@ -6,6 +6,15 @@ Version 76:
|
|||||||
* Add serializer::get
|
* Add serializer::get
|
||||||
* Add serializer::chunked
|
* 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:
|
Version 75:
|
||||||
|
@@ -86,7 +86,7 @@ next(error_code& ec, Visit&& visit)
|
|||||||
{
|
{
|
||||||
frdinit(std::integral_constant<bool,
|
frdinit(std::integral_constant<bool,
|
||||||
isRequest>{});
|
isRequest>{});
|
||||||
close_ = ! frd_->keep_alive();
|
keep_alive_ = frd_->keep_alive();
|
||||||
chunked_ = frd_->chunked();
|
chunked_ = frd_->chunked();
|
||||||
if(chunked_)
|
if(chunked_)
|
||||||
goto go_init_c;
|
goto go_init_c;
|
||||||
|
@@ -163,7 +163,7 @@ operator()(
|
|||||||
{
|
{
|
||||||
sr_.consume(bytes_transferred);
|
sr_.consume(bytes_transferred);
|
||||||
if(sr_.is_done())
|
if(sr_.is_done())
|
||||||
if(sr_.need_close())
|
if(! sr_.keep_alive())
|
||||||
ec = error::end_of_stream;
|
ec = error::end_of_stream;
|
||||||
}
|
}
|
||||||
h_(ec);
|
h_(ec);
|
||||||
@@ -480,11 +480,11 @@ write_some(
|
|||||||
if(f.invoked)
|
if(f.invoked)
|
||||||
sr.consume(f.bytes_transferred);
|
sr.consume(f.bytes_transferred);
|
||||||
if(sr.is_done())
|
if(sr.is_done())
|
||||||
if(sr.need_close())
|
if(! sr.keep_alive())
|
||||||
ec = error::end_of_stream;
|
ec = error::end_of_stream;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(sr.need_close())
|
if(! sr.keep_alive())
|
||||||
ec = error::end_of_stream;
|
ec = error::end_of_stream;
|
||||||
else
|
else
|
||||||
ec.assign(0, ec.category());
|
ec.assign(0, ec.category());
|
||||||
|
@@ -67,7 +67,7 @@ struct no_chunk_decorator
|
|||||||
if the contents of the message indicate that chunk encoding
|
if the contents of the message indicate that chunk encoding
|
||||||
is required. If the semantics of the message indicate that
|
is required. If the semantics of the message indicate that
|
||||||
the connection should be closed after the message is sent, the
|
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
|
Upon construction, an optional chunk decorator may be
|
||||||
specified. This decorator is a function object called with
|
specified. This decorator is a function object called with
|
||||||
@@ -268,7 +268,7 @@ private:
|
|||||||
bool split_ = false;
|
bool split_ = false;
|
||||||
bool header_done_ = false;
|
bool header_done_ = false;
|
||||||
bool chunked_;
|
bool chunked_;
|
||||||
bool close_;
|
bool keep_alive_;
|
||||||
bool more_;
|
bool more_;
|
||||||
ChunkDecorator d_;
|
ChunkDecorator d_;
|
||||||
|
|
||||||
@@ -396,21 +396,28 @@ public:
|
|||||||
return chunked_;
|
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
|
This function returns `true` if the semantics of the
|
||||||
the body may be indicated by the end of file. In order
|
message indicate that the connection should be kept open
|
||||||
for the recipient (if any) to receive a complete message,
|
after the serialized message has been transmitted. The
|
||||||
the underlying network connection must be closed when this
|
value depends on the HTTP version of the message,
|
||||||
function returns `true`.
|
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
|
This function may only be called if @ref is_header_done
|
||||||
would return `true`.
|
would return `true`.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
need_close() const
|
keep_alive()
|
||||||
{
|
{
|
||||||
return close_;
|
return keep_alive_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the next set of buffers in the serialization.
|
/** Returns the next set of buffers in the serialization.
|
||||||
|
Reference in New Issue
Block a user