33 #ifndef GENLIB_NET_HTTP_HTTPPARSER_H
34 #define GENLIB_NET_HTTP_HTTPPARSER_H
80 #define ENTREAD_DETERMINE_READ_METHOD 1
81 #define ENTREAD_USING_CLEN 2
82 #define ENTREAD_USING_CHUNKED 3
83 #define ENTREAD_UNTIL_CLOSE 4
84 #define ENTREAD_CHUNKY_BODY 5
85 #define ENTREAD_CHUNKY_HEADERS 6
94 HTTPMETHOD_PUT = UPNP_HTTPMETHOD_PUT,
95 HTTPMETHOD_DELETE = UPNP_HTTPMETHOD_DELETE,
96 HTTPMETHOD_GET = UPNP_HTTPMETHOD_GET,
97 HTTPMETHOD_HEAD = UPNP_HTTPMETHOD_HEAD,
98 HTTPMETHOD_POST = UPNP_HTTPMETHOD_POST,
100 HTTPMETHOD_SUBSCRIBE,
101 HTTPMETHOD_UNSUBSCRIBE,
110 #define HDR_UNKNOWN -1
111 #define HDR_CACHE_CONTROL 1
112 #define HDR_CALLBACK 2
113 #define HDR_CONTENT_LENGTH 3
114 #define HDR_CONTENT_TYPE 4
121 #define HDR_LOCATION 11
126 #define HDR_SERVER 16
129 #define HDR_SOAPACTION 19
131 #define HDR_TIMEOUT 21
132 #define HDR_TRANSFER_ENCODING 22
134 #define HDR_USER_AGENT 24
137 #define HDR_ACCEPT 25
138 #define HDR_ACCEPT_ENCODING 26
139 #define HDR_ACCEPT_CHARSET 27
140 #define HDR_ACCEPT_LANGUAGE 28
141 #define HDR_ACCEPT_RANGE 29
142 #define HDR_CONTENT_ENCODING 30
143 #define HDR_CONTENT_LANGUAGE 31
144 #define HDR_CONTENT_LOCATION 32
145 #define HDR_CONTENT_RANGE 33
146 #define HDR_IF_RANGE 34
226 parser_pos_t position;
228 unsigned int content_length;
328 void parser_response_init(
http_parser_t *parser, http_method_t request_method);
439 parse_status_t matchstr(
char *str,
size_t slen,
const char *fmt, ...);
453 int raw_to_int(
memptr *raw_value,
int base);
469 int raw_find_str(
memptr *raw_value,
const char *str);
483 const char *method_to_str(http_method_t method);
494 #define print_http_headers(hmsg) \
void print_http_headers(http_message_t *hmsg)
Print the HTTP headers.
Definition: httpparser.c:2223
parse_status_t
Definition: httpparser.h:152
@ PARSE_INCOMPLETE
Definition: httpparser.h:156
@ PARSE_NO_MATCH
Definition: httpparser.h:164
@ PARSE_FAILURE
Definition: httpparser.h:160
@ PARSE_INCOMPLETE_ENTITY
Definition: httpparser.h:158
@ PARSE_SUCCESS
Definition: httpparser.h:154
@ PARSE_OK
Definition: httpparser.h:162
@ PARSE_CONTINUE_1
Definition: httpparser.h:166
Definition: LinkedList.h:84
Represents a URI used in parse_uri and elsewhere.
Definition: uri.h:134
Definition: httpparser.h:182
uri_type uri
Definition: httpparser.h:187
http_method_t method
Definition: httpparser.h:185
int is_request
Definition: httpparser.h:200
membuffer status_msg
Definition: httpparser.h:193
memptr entity
Definition: httpparser.h:208
char * urlbuf
Definition: httpparser.h:213
size_t amount_discarded
Definition: httpparser.h:197
int status_code
Definition: httpparser.h:191
membuffer msg
Definition: httpparser.h:211
http_method_t request_method
Definition: httpparser.h:189
LinkedList headers
Definition: httpparser.h:206
Definition: httpparser.h:217
int http_error_code
Definition: httpparser.h:221
int valid_ssdp_notify_hack
Definition: httpparser.h:224
size_t entity_start_position
Definition: httpparser.h:232
Definition: membuffer.h:58
Definition: membuffer.h:48
Definition: httpparser.h:61
int entire_msg_loaded
Definition: httpparser.h:68
membuffer * msg
Definition: httpparser.h:63
size_t cursor
Definition: httpparser.h:65