forked from boostorg/beast
Parser body_limit is optional (API Change):
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 #1897 closes #1965
This commit is contained in:
@@ -69,8 +69,9 @@ template<bool isRequest>
|
||||
class basic_parser
|
||||
: private detail::basic_parser_base
|
||||
{
|
||||
std::uint64_t body_limit_ =
|
||||
default_body_limit(is_request{}); // max payload body
|
||||
boost::optional<std::uint64_t>
|
||||
body_limit_ =
|
||||
default_body_limit(is_request{}); // max payload body
|
||||
std::uint64_t len_ = 0; // size of chunk or body
|
||||
std::uint64_t len0_ = 0; // content length if known
|
||||
std::unique_ptr<char[]> buf_; // temp storage
|
||||
@@ -289,10 +290,11 @@ public:
|
||||
|
||||
The default limit is 1MB for requests and 8MB for responses.
|
||||
|
||||
@param v The payload body limit to set
|
||||
@param v An optional integral value representing the body limit.
|
||||
If this is equal to `boost::none`, then the body limit is disabled.
|
||||
*/
|
||||
void
|
||||
body_limit(std::uint64_t v)
|
||||
body_limit(boost::optional<std::uint64_t> v)
|
||||
{
|
||||
body_limit_ = v;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user