mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 14:24:31 +02:00
Fix handling of body_what::pause in basic_parser_v1
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
* Tidy up basic_headers for documentation
|
* Tidy up basic_headers for documentation
|
||||||
* Tidy up documentation
|
* Tidy up documentation
|
||||||
* Add basic_parser_v1::reset
|
* Add basic_parser_v1::reset
|
||||||
|
* Fix handling of body_what::pause in basic_parser_v1
|
||||||
|
|
||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
|
@@ -422,7 +422,10 @@ public:
|
|||||||
bool
|
bool
|
||||||
complete() const
|
complete() const
|
||||||
{
|
{
|
||||||
return s_ == s_restart || s_ == s_closed_complete;
|
return
|
||||||
|
s_ == s_restart ||
|
||||||
|
s_ == s_closed_complete ||
|
||||||
|
s_ == s_body_pause;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Write a sequence of buffers to the parser.
|
/** Write a sequence of buffers to the parser.
|
||||||
|
@@ -127,7 +127,7 @@ protected:
|
|||||||
s_chunk_data_cr,
|
s_chunk_data_cr,
|
||||||
s_chunk_data_lf,
|
s_chunk_data_lf,
|
||||||
|
|
||||||
s_body_what,
|
s_body_pause,
|
||||||
s_body_identity0,
|
s_body_identity0,
|
||||||
s_body_identity,
|
s_body_identity,
|
||||||
s_body_identity_eof0,
|
s_body_identity_eof0,
|
||||||
|
@@ -902,11 +902,29 @@ write(boost::asio::const_buffer const& buffer, error_code& ec)
|
|||||||
call_on_headers(ec);
|
call_on_headers(ec);
|
||||||
if(ec)
|
if(ec)
|
||||||
return errc();
|
return errc();
|
||||||
s_ = s_body_what;
|
auto const what = call_on_body_what(ec);
|
||||||
// fall through
|
if(ec)
|
||||||
|
return errc();
|
||||||
|
switch(what)
|
||||||
|
{
|
||||||
|
case body_what::normal:
|
||||||
|
break;
|
||||||
|
case body_what::upgrade:
|
||||||
|
upgrade_ = true;
|
||||||
|
// fall through
|
||||||
|
case body_what::skip:
|
||||||
|
flags_ |= parse_flag::skipbody;
|
||||||
|
break;
|
||||||
|
case body_what::pause:
|
||||||
|
++p;
|
||||||
|
s_ = s_body_pause;
|
||||||
|
return used();
|
||||||
|
}
|
||||||
|
s_ = s_headers_done;
|
||||||
|
goto redo;
|
||||||
}
|
}
|
||||||
|
|
||||||
case s_body_what:
|
case s_body_pause:
|
||||||
{
|
{
|
||||||
auto const what = call_on_body_what(ec);
|
auto const what = call_on_body_what(ec);
|
||||||
if(ec)
|
if(ec)
|
||||||
|
Reference in New Issue
Block a user