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
125 #define HDR_SERVER 16
128 #define HDR_SOAPACTION 19
130 #define HDR_TIMEOUT 21
131 #define HDR_TRANSFER_ENCODING 22
133 #define HDR_USER_AGENT 24
136 #define HDR_ACCEPT 25
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;
327 void parser_response_init(
http_parser_t *parser, http_method_t request_method);
438 parse_status_t matchstr(
char *str,
size_t slen,
const char *fmt, ...);
452 int raw_to_int(
memptr *raw_value,
int base);
468 int raw_find_str(
memptr *raw_value,
const char *str);
482 const char *method_to_str(http_method_t method);
493 #define print_http_headers(h_msg) \
parse_status_t
Definition: httpparser.h:150
int entire_msg_loaded
Definition: httpparser.h:67
int http_error_code
Definition: httpparser.h:220
Definition: httpparser.h:180
Definition: httpparser.h:157
uri_type uri
Definition: httpparser.h:186
membuffer * msg
Definition: httpparser.h:62
memptr entity
Definition: httpparser.h:207
Represents a URI used in parse_uri and elsewhere.
Definition: uri.h:133
size_t amount_discarded
Definition: httpparser.h:196
char * url_buf
Definition: httpparser.h:212
Definition: httpparser.h:165
void print_http_headers(http_message_t *h_msg)
Print the HTTP headers.
Definition: httpparser.c:2223
Definition: httpparser.h:153
Definition: httpparser.h:163
Definition: httpparser.h:155
Definition: httpparser.h:59
membuffer status_msg
Definition: httpparser.h:192
size_t entity_start_position
Definition: httpparser.h:231
http_method_t method
Definition: httpparser.h:184
int is_request
Definition: httpparser.h:199
size_t cursor
Definition: httpparser.h:64
Definition: httpparser.h:215
membuffer msg
Definition: httpparser.h:210
http_method_t request_method
Definition: httpparser.h:188
Definition: httpparser.h:159
Definition: membuffer.h:57
Definition: membuffer.h:47
LinkedList headers
Definition: httpparser.h:205
Definition: LinkedList.h:83
int valid_ssdp_notify_hack
Definition: httpparser.h:223
Definition: httpparser.h:161
int status_code
Definition: httpparser.h:190