mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 14:24:31 +02:00
Add basic_parser_v1::reset
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
* Add is_Reader trait
|
* Add is_Reader trait
|
||||||
* Tidy up basic_headers for documentation
|
* Tidy up basic_headers for documentation
|
||||||
* Tidy up documentation
|
* Tidy up documentation
|
||||||
|
* Add basic_parser_v1::reset
|
||||||
|
|
||||||
API Changes:
|
API Changes:
|
||||||
|
|
||||||
|
@@ -467,6 +467,15 @@ public:
|
|||||||
void
|
void
|
||||||
write_eof(error_code& ec);
|
write_eof(error_code& ec);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** Reset the parsing state.
|
||||||
|
|
||||||
|
The state of the parser is reset to expect the beginning of
|
||||||
|
a new request or response. The old state is discarded.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Derived&
|
Derived&
|
||||||
impl()
|
impl()
|
||||||
@@ -486,14 +495,6 @@ private:
|
|||||||
s_ = s_res_start;
|
s_ = s_res_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
reset()
|
|
||||||
{
|
|
||||||
h_left_ = h_max_;
|
|
||||||
b_left_ = b_max_;
|
|
||||||
reset(std::integral_constant<bool, isRequest>{});
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
init(std::true_type)
|
init(std::true_type)
|
||||||
{
|
{
|
||||||
|
@@ -1175,6 +1175,16 @@ write_eof(error_code& ec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<bool isRequest, class Derived>
|
||||||
|
void
|
||||||
|
basic_parser_v1<isRequest, Derived>::
|
||||||
|
reset()
|
||||||
|
{
|
||||||
|
h_left_ = h_max_;
|
||||||
|
b_left_ = b_max_;
|
||||||
|
reset(std::integral_constant<bool, isRequest>{});
|
||||||
|
}
|
||||||
|
|
||||||
template<bool isRequest, class Derived>
|
template<bool isRequest, class Derived>
|
||||||
bool
|
bool
|
||||||
basic_parser_v1<isRequest, Derived>::
|
basic_parser_v1<isRequest, Derived>::
|
||||||
|
Reference in New Issue
Block a user