From ebe52537ea68a3d556d5f9cb0663c0ea7120731d Mon Sep 17 00:00:00 2001 From: Mohamed El Housseine Date: Thu, 4 Apr 2019 19:19:32 +0200 Subject: [PATCH] Set parser status and flags even if body_limit_ has been reached close #1556 --- include/boost/beast/http/impl/basic_parser.ipp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/boost/beast/http/impl/basic_parser.ipp b/include/boost/beast/http/impl/basic_parser.ipp index 99947ae1..0d9e3a9f 100644 --- a/include/boost/beast/http/impl/basic_parser.ipp +++ b/include/boost/beast/http/impl/basic_parser.ipp @@ -508,15 +508,16 @@ finish_header(error_code& ec, std::false_type) } else if(f_ & flagContentLength) { - if(len_ > body_limit_) - { - ec = error::body_limit; - return; - } if(len_ > 0) { f_ |= flagHasBody; state_ = state::body0; + + if(len_ > body_limit_) + { + ec = error::body_limit; + return; + } } else {