|
|
@ -198,7 +198,6 @@ enum state |
|
|
|
, s_header_almost_done |
|
|
|
|
|
|
|
, s_headers_almost_done |
|
|
|
, s_headers_done |
|
|
|
|
|
|
|
, s_chunk_size_start |
|
|
|
, s_chunk_size |
|
|
@ -236,10 +235,10 @@ enum header_states |
|
|
|
}; |
|
|
|
|
|
|
|
enum flags |
|
|
|
{ F_CHUNKED = 0x0001 |
|
|
|
, F_CONNECTION_KEEP_ALIVE = 0x0002 |
|
|
|
, F_CONNECTION_CLOSE = 0x0004 |
|
|
|
, F_TRAILING = 0x0010 |
|
|
|
{ F_CHUNKED = 1 << 0 |
|
|
|
, F_CONNECTION_KEEP_ALIVE = 1 << 1 |
|
|
|
, F_CONNECTION_CLOSE = 1 << 2 |
|
|
|
, F_TRAILING = 1 << 3 |
|
|
|
}; |
|
|
|
|
|
|
|
#define CR '\r' |
|
|
@ -931,8 +930,10 @@ size_t parse (http_parser *parser, const char *data, size_t len, int start_state |
|
|
|
} |
|
|
|
|
|
|
|
if (ch == LF) { |
|
|
|
state = s_headers_done; |
|
|
|
break; |
|
|
|
/* they might be just sending \n instead of \r\n so this would be
|
|
|
|
* the second \n to denote the end of headers*/ |
|
|
|
state = s_headers_almost_done; |
|
|
|
goto headers_almost_done; |
|
|
|
} |
|
|
|
|
|
|
|
c = LOWER(ch); |
|
|
@ -1138,8 +1139,7 @@ size_t parse (http_parser *parser, const char *data, size_t len, int start_state |
|
|
|
|
|
|
|
if (ch == LF) { |
|
|
|
CALLBACK(header_value); |
|
|
|
state = s_header_field_start; |
|
|
|
break; |
|
|
|
goto header_almost_done; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
@ -1206,6 +1206,7 @@ size_t parse (http_parser *parser, const char *data, size_t len, int start_state |
|
|
|
} |
|
|
|
|
|
|
|
case s_header_almost_done: |
|
|
|
header_almost_done: |
|
|
|
{ |
|
|
|
STRICT_CHECK(ch != LF); |
|
|
|
|
|
|
@ -1228,6 +1229,7 @@ size_t parse (http_parser *parser, const char *data, size_t len, int start_state |
|
|
|
} |
|
|
|
|
|
|
|
case s_headers_almost_done: |
|
|
|
headers_almost_done: |
|
|
|
{ |
|
|
|
STRICT_CHECK(ch != LF); |
|
|
|
|
|
|
|