Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Expose HTTP header boundary #89

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ size_t http_parser_execute (http_parser *parser,
ch = *p;

if (PARSING_HEADER(parser->state)) {
++parser->boundary;
++parser->nread;
/* Buffer overflow attack */
if (parser->nread > HTTP_MAX_HEADER_SIZE) {
Expand Down Expand Up @@ -1902,6 +1903,7 @@ http_parser_init (http_parser *parser, enum http_parser_type t)
parser->data = data;
parser->type = t;
parser->state = (t == HTTP_REQUEST ? s_start_req : (t == HTTP_RESPONSE ? s_start_res : s_start_req_or_res));
parser->boundary = 0;
parser->http_errno = HPE_OK;
}

Expand Down
1 change: 1 addition & 0 deletions http_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ struct http_parser {
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */

/** READ-ONLY **/
uint32_t boundary;
unsigned short http_major;
unsigned short http_minor;
unsigned short status_code; /* responses only */
Expand Down