forked from boostorg/beast
Return std::size_t from Body::writer::put (API Change)
`put` returns the number of bytes actually transferred from the input buffers. Actions Required: * Return the number of bytes actually transferred from the input buffers in user defined `Body::writer::put` functions.
This commit is contained in:
@@ -523,12 +523,12 @@ basic_parser<isRequest, Derived>::
|
||||
parse_body(char const*& p,
|
||||
std::size_t n, error_code& ec)
|
||||
{
|
||||
n = beast::detail::clamp(len_, n);
|
||||
impl().on_data(string_view{p, n}, ec);
|
||||
if(ec)
|
||||
return;
|
||||
n = impl().on_data(string_view{p,
|
||||
beast::detail::clamp(len_, n)}, ec);
|
||||
p += n;
|
||||
len_ -= n;
|
||||
if(ec)
|
||||
return;
|
||||
if(len_ > 0)
|
||||
return;
|
||||
impl().on_complete(ec);
|
||||
@@ -550,10 +550,10 @@ parse_body_to_eof(char const*& p,
|
||||
return;
|
||||
}
|
||||
body_limit_ = body_limit_ - n;
|
||||
impl().on_data(string_view{p, n}, ec);
|
||||
n = impl().on_data(string_view{p, n}, ec);
|
||||
p += n;
|
||||
if(ec)
|
||||
return;
|
||||
p += n;
|
||||
}
|
||||
|
||||
template<bool isRequest, class Derived>
|
||||
@@ -701,12 +701,12 @@ basic_parser<isRequest, Derived>::
|
||||
parse_chunk_body(char const*& p,
|
||||
std::size_t n, error_code& ec)
|
||||
{
|
||||
n = beast::detail::clamp(len_, n);
|
||||
impl().on_data(string_view{p, n}, ec);
|
||||
if(ec)
|
||||
return;
|
||||
n = impl().on_data(string_view{p,
|
||||
beast::detail::clamp(len_, n)}, ec);
|
||||
p += n;
|
||||
len_ -= n;
|
||||
if(ec)
|
||||
return;
|
||||
if(len_ > 0)
|
||||
return;
|
||||
state_ = state::chunk_header;
|
||||
|
||||
Reference in New Issue
Block a user