refactor http parsing and prevent read body more than content-length

This commit is contained in:
Seven Du
2014-09-06 19:35:05 +08:00
parent aa15994c7f
commit c02b2427e8
3 changed files with 28 additions and 15 deletions
+3 -2
View File
@@ -1116,13 +1116,14 @@ typedef struct switch_http_request_s {
switch_bool_t keepalive;
const char *content_type;
switch_size_t content_length;
switch_size_t bytes_header;
switch_size_t bytes_read;
switch_size_t bytes_buffered;
switch_event_t *headers;
void *user_data; /* private user data */
/* private members used by the parser internally */
char *_buffer;
const char *_unparsed_data;
switch_size_t _unparsed_len;
switch_bool_t _destroy_headers;
} switch_http_request_t;