The missing error check leads to completely ignoring the body limit,
as the body limit is compared to the "Content-Length" header inside
the "finish_header" method.
closes#2201
API Changes:
`string_param`, which was previously the argument type when setting field values
has been replaced by `string_view`. Because of this, it is no longer possible to
set message field values directly as integrals.
Users are required to convert numeric arguments to a string type prior to calling
`fields::set` et. al.
Beast provides the non-allocating `to_static_string()` function for this purpose.
To set Content-Length field manually, call `message::content_length`.
fixes#1956
API Changes:
The signature of basic_parser<>::body_limit(n) has changed. It now accepts an
optional std::uint64_t. The caller may indicate that no body limit is required
by calling body_limit(boost::none). The default limits remain in place in order
to maintain 'safe by default' behaviour.
closes#1897closes#1965
C++14 or later is required to support completion tokens that use
per-operation return type deduction. For C++11, a completion
token's async_result specialisation must still provide the nested
typedef `return_type`.
clang complains about missing initializer (even though the field was
properly initialized by the default constructor).
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
`asio::coroutine` is an extension, which is not part of
the Networking TS, so the `net` alias is not appropriate in this case.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
The `temporary_buffer<A>` class template replaces the use of
`static_string` in `http::fields`, simplifying `set_chunked_impl` and
`set_keep_alive_impl`.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
Not using lambdas in this case reduced the number of instantiations of
the algorithm by a factor of 4x at no (observable) runtime cost.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
close#1574
This change yields a modest performance improment of 1-2% by replacing
the exception-based handling of buffer overflow with one based on
regular conditional checks.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
fix#1375
* The value returned from `basic_parser::content_length`
no longer changes as the body of the message is received.
Actions Required:
* Call `basic_parser::content_length_remaining` instead
of `basic_parser::content_length`.