Skip to content

Commit

Permalink
lib-http: message parsers: Record beginning of parsed data.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch authored and sirainen committed Feb 26, 2018
1 parent 924b225 commit 8f985b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib-http/http-message-parser.h
Expand Up @@ -47,7 +47,7 @@ struct http_message_parser {
uoff_t max_payload_size;
enum http_message_parse_flags flags;

const unsigned char *cur, *end;
const unsigned char *begin, *cur, *end;

const char *error;
enum http_message_parse_error error_code;
Expand Down
4 changes: 2 additions & 2 deletions src/lib-http/http-request-parser.c
Expand Up @@ -292,8 +292,8 @@ static int http_request_parse_request_line(struct http_request_parser *parser,

while ((ret = i_stream_read_bytes(_parser->input, &begin, &size,
old_bytes + 1)) > 0) {
_parser->cur = begin;
_parser->end = _parser->cur + size;
_parser->begin = _parser->cur = begin;
_parser->end = _parser->begin + size;

if ((ret = http_request_parse(parser, pool)) < 0)
return -1;
Expand Down
4 changes: 2 additions & 2 deletions src/lib-http/http-response-parser.c
Expand Up @@ -244,8 +244,8 @@ http_response_parse_status_line(struct http_response_parser *parser)

while ((ret = i_stream_read_bytes(_parser->input, &begin, &size,
old_bytes + 1)) > 0) {
_parser->cur = begin;
_parser->end = _parser->cur + size;
_parser->begin = _parser->cur = begin;
_parser->end = _parser->begin + size;

if ((ret = http_response_parse(parser)) < 0)
return -1;
Expand Down

0 comments on commit 8f985b8

Please sign in to comment.