HTTP parser. More...
Data Structures | |
struct | vtm_http_parser |
Macros | |
#define | VTM_HTTP_DEF_MAX_HEADER_SIZE 8192 |
#define | VTM_HTTP_DEF_MAX_BODY_SIZE (8*1024*1024) |
Enumerations | |
enum | vtm_http_parser_mode { VTM_HTTP_PM_REQUEST, VTM_HTTP_PM_RESPONSE } |
enum | vtm_http_parser_state { VTM_HTTP_PARSE_BEGIN, VTM_HTTP_PARSE_REQ_METHOD, VTM_HTTP_PARSE_REQ_PATH, VTM_HTTP_PARSE_REQ_PARAM_BEGIN, VTM_HTTP_PARSE_REQ_PARAM_NAME, VTM_HTTP_PARSE_REQ_PARAM_VALUE, VTM_HTTP_PARSE_REQ_LINE_LF, VTM_HTTP_PARSE_RES_STATUS_CODE, VTM_HTTP_PARSE_RES_STATUS_MSG_CR, VTM_HTTP_PARSE_RES_STATUS_MSG_LF, VTM_HTTP_PARSE_VERSION_H, VTM_HTTP_PARSE_VERSION_HT, VTM_HTTP_PARSE_VERSION_HTT, VTM_HTTP_PARSE_VERSION_HTTP, VTM_HTTP_PARSE_VERSION_SLASH, VTM_HTTP_PARSE_VERSION_MAJOR, VTM_HTTP_PARSE_VERSION_MINOR, VTM_HTTP_PARSE_HEADER_LINE_BEGIN, VTM_HTTP_PARSE_HEADER_NAME, VTM_HTTP_PARSE_HEADER_VALUE, VTM_HTTP_PARSE_HEADER_LINE_LF, VTM_HTTP_PARSE_HEADER_LINE_COMPLETE, VTM_HTTP_PARSE_HEADERS_END_LF, VTM_HTTP_PARSE_BODY, VTM_HTTP_PARSE_BODY_READALL, VTM_HTTP_PARSE_BODY_FIXEDLENGTH, VTM_HTTP_PARSE_BODY_CHUNKED, VTM_HTTP_PARSE_BODY_CHUNK_SIZE, VTM_HTTP_PARSE_BODY_CHUNK_SIZE_LF, VTM_HTTP_PARSE_BODY_CHUNK_CONTENT, VTM_HTTP_PARSE_BODY_CHUNK_END_LF, VTM_HTTP_PARSE_COMPLETE } |
Functions | |
VTM_API void | vtm_http_parser_init (struct vtm_http_parser *par, enum vtm_http_parser_mode mode) |
VTM_API void | vtm_http_parser_release (struct vtm_http_parser *par) |
VTM_API void | vtm_http_parser_reset (struct vtm_http_parser *par) |
VTM_API enum vtm_net_recv_stat | vtm_http_parser_run (struct vtm_http_parser *par, struct vtm_buf *buf) |
#define VTM_HTTP_DEF_MAX_HEADER_SIZE 8192 |
default maximum header size in bytes
#define VTM_HTTP_DEF_MAX_BODY_SIZE (8*1024*1024) |
default maximum body size in bytes
enum vtm_http_parser_mode |
VTM_API void vtm_http_parser_init | ( | struct vtm_http_parser * | par, |
enum vtm_http_parser_mode | mode | ||
) |
Initializes the parser for the given mode.
par | the parser that should be initialized |
mode | the mode under which the parser should run |
VTM_API void vtm_http_parser_release | ( | struct vtm_http_parser * | par | ) |
Releases the parser and all allocated resources.
After this call the parser is no longer valid.
par | the parser that should be released |
VTM_API void vtm_http_parser_reset | ( | struct vtm_http_parser * | par | ) |
Resets the parser for parsing a new request or response.
par | the parser that should be reset |
VTM_API enum vtm_net_recv_stat vtm_http_parser_run | ( | struct vtm_http_parser * | par, |
struct vtm_buf * | buf | ||
) |
Lets the parser examine the input data.
par | the parser the should run |
buf | the input buffer for the parser |