Retain ownership when reading using a message

fix #469
This commit is contained in:
Vinnie Falco
2017-06-11 11:49:04 -07:00
parent 8c4136bb73
commit f44380159a
3 changed files with 9 additions and 7 deletions

View File

@ -6,6 +6,7 @@ Version 54:
* consuming_buffers members and coverage
* basic_fields members and coverage
* Add string_param
* Retain ownership when reading using a message
API Changes:

View File

@ -325,6 +325,7 @@ class read_msg_op
: s(s_)
, b(b_)
, m(m_)
, p(std::move(m))
{
p.eager(true);
}
@ -725,7 +726,7 @@ read(
"Body requirements not met");
static_assert(is_body_writer<Body>::value,
"BodyWriter requirements not met");
parser<isRequest, Body, Fields> p;
parser<isRequest, Body, Fields> p{std::move(msg)};
p.eager(true);
read(stream, buffer, p.base(), ec);
if(ec)

View File

@ -604,8 +604,8 @@ async_read(
dynamic buffer's input sequence will be given to the parser
first.
@param msg An object used to store the message. Any contents will
be overwritten. The type must support copy or move assignment.
@param msg An object to be overwritten with the message contents.
The type must be @b MoveAssignable and @b MoveConstructible.
@throws system_error Thrown on failure.
*/
@ -654,8 +654,8 @@ read(
dynamic buffer's input sequence will be given to the parser
first.
@param msg An object used to store the message. Any contents will
be overwritten. The type must support copy or move assignment.
@param msg An object to be overwritten with the message contents.
The type must be @b MoveAssignable and @b MoveConstructible.
@param ec Set to the error, if any occurred.
*/
@ -709,8 +709,8 @@ read(
dynamic buffer's input sequence will be given to the parser
first.
@param msg An object used to store the message. Any contents will
be overwritten. The type must support copy or move assignment.
@param msg An object to be overwritten with the message contents.
The type must be @b MoveAssignable and @b MoveConstructible.
The object must remain valid at least until the
handler is called; ownership is not transferred.