HttpParser: Add Reset() function (#1210)

This allows reuse of the HttpParser object for multiple requests.
This commit is contained in:
Peter Johnson
2018-07-22 19:41:23 -07:00
committed by GitHub
parent 794403dcea
commit c25d48fd0c
3 changed files with 39 additions and 0 deletions

View File

@@ -36,8 +36,19 @@ class HttpParser {
*/
static uint32_t GetParserVersion();
/**
* Constructor.
* @param type Type of parser (request or response or both)
*/
explicit HttpParser(Type type);
/**
* Reset the parser to initial state.
* This allows reusing the same parser object from request to request.
* @param type Type of parser (request or response or both)
*/
void Reset(Type type);
/**
* Set the maximum accepted length for URLs, field names, and field values.
* The default is 1024.