33#ifndef GENLIB_NET_HTTP_HTTPPARSER_H
34#define GENLIB_NET_HTTP_HTTPPARSER_H
79#define ENTREAD_DETERMINE_READ_METHOD 1
80#define ENTREAD_USING_CLEN 2
81#define ENTREAD_USING_CHUNKED 3
82#define ENTREAD_UNTIL_CLOSE 4
83#define ENTREAD_CHUNKY_BODY 5
84#define ENTREAD_CHUNKY_HEADERS 6
93 HTTPMETHOD_PUT = UPNP_HTTPMETHOD_PUT,
94 HTTPMETHOD_DELETE = UPNP_HTTPMETHOD_DELETE,
95 HTTPMETHOD_GET = UPNP_HTTPMETHOD_GET,
96 HTTPMETHOD_HEAD = UPNP_HTTPMETHOD_HEAD,
97 HTTPMETHOD_POST = UPNP_HTTPMETHOD_POST,
100 HTTPMETHOD_UNSUBSCRIBE,
109#define HDR_UNKNOWN -1
110#define HDR_CACHE_CONTROL 1
111#define HDR_CALLBACK 2
112#define HDR_CONTENT_LENGTH 3
113#define HDR_CONTENT_TYPE 4
120#define HDR_LOCATION 11
128#define HDR_SOAPACTION 19
130#define HDR_TIMEOUT 21
131#define HDR_TRANSFER_ENCODING 22
133#define HDR_USER_AGENT 24
137#define HDR_ACCEPT_ENCODING 26
138#define HDR_ACCEPT_CHARSET 27
139#define HDR_ACCEPT_LANGUAGE 28
140#define HDR_ACCEPT_RANGE 29
141#define HDR_CONTENT_ENCODING 30
142#define HDR_CONTENT_LANGUAGE 31
143#define HDR_CONTENT_LOCATION 32
144#define HDR_CONTENT_RANGE 33
145#define HDR_IF_RANGE 34
225 parser_pos_t position;
227 unsigned int content_length;
327void parser_response_init(
http_parser_t *parser, http_method_t request_method);
438parse_status_t matchstr(
char *str,
size_t slen,
const char *fmt, ...);
452int raw_to_int(
memptr *raw_value,
int base);
468int raw_find_str(
memptr *raw_value,
const char *str);
482const char *method_to_str(http_method_t method);
493 #define print_http_headers(h_msg) \
struct LINKEDLIST LinkedList
void print_http_headers(http_message_t *h_msg)
Print the HTTP headers.
Definition httpparser.c:2223
parse_status_t
Definition httpparser.h:151
@ PARSE_INCOMPLETE
Definition httpparser.h:155
@ PARSE_NO_MATCH
Definition httpparser.h:163
@ PARSE_FAILURE
Definition httpparser.h:159
@ PARSE_INCOMPLETE_ENTITY
Definition httpparser.h:157
@ PARSE_SUCCESS
Definition httpparser.h:153
@ PARSE_OK
Definition httpparser.h:161
@ PARSE_CONTINUE_1
Definition httpparser.h:165
Definition httpparser.h:181
uri_type uri
Definition httpparser.h:186
http_method_t method
Definition httpparser.h:184
int is_request
Definition httpparser.h:199
membuffer status_msg
Definition httpparser.h:192
memptr entity
Definition httpparser.h:207
size_t amount_discarded
Definition httpparser.h:196
int status_code
Definition httpparser.h:190
membuffer msg
Definition httpparser.h:210
http_method_t request_method
Definition httpparser.h:188
LinkedList headers
Definition httpparser.h:205
char * url_buf
Definition httpparser.h:212
Definition httpparser.h:216
int http_error_code
Definition httpparser.h:220
int valid_ssdp_notify_hack
Definition httpparser.h:223
size_t entity_start_position
Definition httpparser.h:231
Definition membuffer.h:58
Definition membuffer.h:48
Definition httpparser.h:60
int entire_msg_loaded
Definition httpparser.h:67
membuffer * msg
Definition httpparser.h:62
size_t cursor
Definition httpparser.h:64
struct URI uri_type
Represents a URI used in parse_uri and elsewhere.