#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | http_parser |
struct | http_parser_settings |
struct | http_parser_url |
Macros | |
#define | HTTP_PARSER_VERSION_MAJOR 2 |
#define | HTTP_PARSER_VERSION_MINOR 7 |
#define | HTTP_PARSER_VERSION_PATCH 1 |
#define | HTTP_PARSER_STRICT 0 |
#define | HTTP_MAX_HEADER_SIZE (80*1024) |
#define | HTTP_STATUS_MAP(XX) |
#define | XX(num, name, string) HTTP_STATUS_##name = num, |
#define | HTTP_METHOD_MAP(XX) |
#define | XX(num, name, string) HTTP_##name = num, |
#define | HTTP_ERRNO_MAP(XX) |
#define | HTTP_ERRNO_GEN(n, s) HPE_##n, |
#define | HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno) |
Typedefs | |
typedef struct http_parser | http_parser |
typedef struct http_parser_settings | http_parser_settings |
typedef int(* | http_data_cb )(http_parser *, const char *at, size_t length) |
typedef int(* | http_cb )(http_parser *) |
Functions | |
unsigned long | http_parser_version (void) |
void | http_parser_init (http_parser *parser, enum http_parser_type type) |
void | http_parser_settings_init (http_parser_settings *settings) |
size_t | http_parser_execute (http_parser *parser, const http_parser_settings *settings, const char *data, size_t len) |
int | http_should_keep_alive (const http_parser *parser) |
const char * | http_method_str (enum http_method m) |
const char * | http_errno_name (enum http_errno err) |
const char * | http_errno_description (enum http_errno err) |
void | http_parser_url_init (struct http_parser_url *u) |
int | http_parser_parse_url (const char *buf, size_t buflen, int is_connect, struct http_parser_url *u) |
void | http_parser_pause (http_parser *parser, int paused) |
int | http_body_is_final (const http_parser *parser) |
#define HTTP_ERRNO_GEN | ( | n, | |
s | |||
) | HPE_##n, |
Definition at line 297 of file http_parser.h.
#define HTTP_ERRNO_MAP | ( | XX | ) |
Definition at line 250 of file http_parser.h.
#define HTTP_MAX_HEADER_SIZE (80*1024) |
Definition at line 82 of file http_parser.h.
#define HTTP_METHOD_MAP | ( | XX | ) |
Definition at line 181 of file http_parser.h.
#define HTTP_PARSER_ERRNO | ( | p | ) | ((enum http_errno) (p)->http_errno) |
Definition at line 304 of file http_parser.h.
#define HTTP_PARSER_STRICT 0 |
Definition at line 71 of file http_parser.h.
#define HTTP_PARSER_VERSION_MAJOR 2 |
Definition at line 47 of file http_parser.h.
#define HTTP_PARSER_VERSION_MINOR 7 |
Definition at line 48 of file http_parser.h.
#define HTTP_PARSER_VERSION_PATCH 1 |
Definition at line 49 of file http_parser.h.
#define HTTP_STATUS_MAP | ( | XX | ) |
Definition at line 112 of file http_parser.h.
Definition at line 225 of file http_parser.h.
Definition at line 225 of file http_parser.h.
typedef int(* http_cb)(http_parser *) |
Definition at line 108 of file http_parser.h.
typedef int(* http_data_cb)(http_parser *, const char *at, size_t length) |
Definition at line 107 of file http_parser.h.
typedef struct http_parser http_parser |
Definition at line 85 of file http_parser.h.
typedef struct http_parser_settings http_parser_settings |
Definition at line 86 of file http_parser.h.
enum flags |
Enumerator | |
---|---|
F_CHUNKED | |
F_CONNECTION_KEEP_ALIVE | |
F_CONNECTION_CLOSE | |
F_CONNECTION_UPGRADE | |
F_TRAILING | |
F_UPGRADE | |
F_SKIPBODY | |
F_CONTENTLENGTH |
Definition at line 234 of file http_parser.h.
enum http_errno |
Definition at line 298 of file http_parser.h.
enum http_method |
Definition at line 223 of file http_parser.h.
enum http_parser_type |
Enumerator | |
---|---|
HTTP_REQUEST | |
HTTP_RESPONSE | |
HTTP_BOTH |
Definition at line 230 of file http_parser.h.
Enumerator | |
---|---|
UF_SCHEMA | |
UF_HOST | |
UF_PORT | |
UF_PATH | |
UF_QUERY | |
UF_FRAGMENT | |
UF_USERINFO | |
UF_MAX |
Definition at line 355 of file http_parser.h.
enum http_status |
Definition at line 173 of file http_parser.h.
int http_body_is_final | ( | const http_parser * | parser | ) |
const char* http_errno_description | ( | enum http_errno | err | ) |
Definition at line 2128 of file http_parser.c.
const char* http_errno_name | ( | enum http_errno | err | ) |
Definition at line 2122 of file http_parser.c.
const char* http_method_str | ( | enum http_method | m | ) |
Definition at line 2098 of file http_parser.c.
size_t http_parser_execute | ( | http_parser * | parser, |
const http_parser_settings * | settings, | ||
const char * | data, | ||
size_t | len | ||
) |
Definition at line 653 of file http_parser.c.
void http_parser_init | ( | http_parser * | parser, |
enum http_parser_type | type | ||
) |
Definition at line 2105 of file http_parser.c.
int http_parser_parse_url | ( | const char * | buf, |
size_t | buflen, | ||
int | is_connect, | ||
struct http_parser_url * | u | ||
) |
Definition at line 2303 of file http_parser.c.
void http_parser_pause | ( | http_parser * | parser, |
int | paused | ||
) |
Definition at line 2407 of file http_parser.c.
void http_parser_settings_init | ( | http_parser_settings * | settings | ) |
Definition at line 2116 of file http_parser.c.
void http_parser_url_init | ( | struct http_parser_url * | u | ) |
Definition at line 2298 of file http_parser.c.
unsigned long http_parser_version | ( | void | ) |
Definition at line 2426 of file http_parser.c.
int http_should_keep_alive | ( | const http_parser * | parser | ) |
Definition at line 2079 of file http_parser.c.