#include <http_request_parser.hpp>
Public Member Functions | |
HttpRequestParser () | |
Construct ready to parse the request method. | |
template<typename InputIterator > | |
boost::tuple< boost::tribool, InputIterator > | parse (HttpRequest &req, InputIterator begin, InputIterator end) |
void | reset () |
Reset to initial parser state. | |
Private Types | |
enum | state { method_start, method, uri, http_version_h, http_version_t_1, http_version_t_2, http_version_p, http_version_slash, http_version_major_start, http_version_major, http_version_minor_start, http_version_minor, expecting_newline_1, header_line_start, header_lws, header_name, space_before_header_value, header_value, expecting_newline_2, expecting_newline_3 } |
The current state of the parser. More... | |
Private Member Functions | |
boost::tribool | consume (HttpRequest &req, char input) |
Handle the next character of input. | |
Static Private Member Functions | |
static bool | is_char (int c) |
Check if a byte is an HTTP character. | |
static bool | is_ctl (int c) |
Check if a byte is an HTTP control character. | |
static bool | is_digit (int c) |
Check if a byte is a digit. | |
static bool | is_tspecial (int c) |
Check if a byte is defined as an HTTP tspecial character. | |
Private Attributes | |
enum async_web_server_cpp::HttpRequestParser::state | state_ |
Definition at line 21 of file http_request_parser.hpp.
enum async_web_server_cpp::HttpRequestParser::state [private] |
The current state of the parser.
Definition at line 65 of file http_request_parser.hpp.
Construct ready to parse the request method.
Definition at line 15 of file http_request_parser.cpp.
boost::tribool async_web_server_cpp::HttpRequestParser::consume | ( | HttpRequest & | req, |
char | input | ||
) | [private] |
Handle the next character of input.
Definition at line 25 of file http_request_parser.cpp.
bool async_web_server_cpp::HttpRequestParser::is_char | ( | int | c | ) | [static, private] |
Check if a byte is an HTTP character.
Definition at line 283 of file http_request_parser.cpp.
bool async_web_server_cpp::HttpRequestParser::is_ctl | ( | int | c | ) | [static, private] |
Check if a byte is an HTTP control character.
Definition at line 288 of file http_request_parser.cpp.
bool async_web_server_cpp::HttpRequestParser::is_digit | ( | int | c | ) | [static, private] |
Check if a byte is a digit.
Definition at line 322 of file http_request_parser.cpp.
bool async_web_server_cpp::HttpRequestParser::is_tspecial | ( | int | c | ) | [static, private] |
Check if a byte is defined as an HTTP tspecial character.
Definition at line 293 of file http_request_parser.cpp.
boost::tuple<boost::tribool, InputIterator> async_web_server_cpp::HttpRequestParser::parse | ( | HttpRequest & | req, |
InputIterator | begin, | ||
InputIterator | end | ||
) | [inline] |
Parse some data. The tribool return value is true when a complete request has been parsed, false if the data is invalid, indeterminate when more data is required. The InputIterator return value indicates how much of the input has been consumed.
Definition at line 35 of file http_request_parser.hpp.
Reset to initial parser state.
Definition at line 20 of file http_request_parser.cpp.
enum async_web_server_cpp::HttpRequestParser::state async_web_server_cpp::HttpRequestParser::state_ [private] |