A wrapper for nodejs/http-parser
.
More...
Public Member Functions | |
HTTPParser (Handler *handler) | |
bool | feed (const char *buffer, int length) |
Parse a buffer into the different sections of an HTTP request. More... | |
bool | done () |
void | clear () |
void | process_header () |
void | process_message () |
void | set_connection_parameters () |
request | to_request () const |
Take the parsed HTTP request data and convert it to a crow::request. More... | |
Static Public Member Functions | |
static int | on_message_begin (http_parser *self_) |
static int | on_url (http_parser *self_, const char *at, size_t length) |
static int | on_header_field (http_parser *self_, const char *at, size_t length) |
static int | on_header_value (http_parser *self_, const char *at, size_t length) |
static int | on_headers_complete (http_parser *self_) |
static int | on_body (http_parser *self_, const char *at, size_t length) |
static int | on_message_complete (http_parser *self_) |
Public Attributes | |
std::string | raw_url |
std::string | url |
int | header_building_state = 0 |
std::string | header_field |
std::string | header_value |
ci_map | headers |
query_string | url_params |
What comes after the ? in the URL. More... | |
std::string | body |
bool | keep_alive |
Whether or not the server should send a connection: Keep-Alive header to the client. More... | |
bool | close_connection |
Whether or not the server should shut down the TCP connection once a response is sent. More... | |
Handler * | handler_ |
This is currently an HTTP connection object (crow::Connection). More... | |
A wrapper for nodejs/http-parser
.
Used to generate a crow::request from the TCP socket buffer.
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Parse a buffer into the different sections of an HTTP request.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Take the parsed HTTP request data and convert it to a crow::request.
std::string crow::HTTPParser< Handler >::raw_url |
std::string crow::HTTPParser< Handler >::url |
int crow::HTTPParser< Handler >::header_building_state = 0 |
std::string crow::HTTPParser< Handler >::header_field |
std::string crow::HTTPParser< Handler >::header_value |
ci_map crow::HTTPParser< Handler >::headers |
query_string crow::HTTPParser< Handler >::url_params |
What comes after the ?
in the URL.
std::string crow::HTTPParser< Handler >::body |
bool crow::HTTPParser< Handler >::keep_alive |
Whether or not the server should send a connection: Keep-Alive
header to the client.
bool crow::HTTPParser< Handler >::close_connection |
Whether or not the server should shut down the TCP connection once a response is sent.
Handler* crow::HTTPParser< Handler >::handler_ |
This is currently an HTTP connection object (crow::Connection).