Skip to content
Snippets Groups Projects
Commit c61b685a authored by Ionut-Francisc Oancea's avatar Ionut-Francisc Oancea
Browse files

Fixed bug in the s_header_value state

If the buffer ended with the '\r' char on the s_header_value state, the parser triggered the on_header_value() callback twice (buffer="data\r"): 1st time with "data" and 2nd time "data\r" resulting in "datadata\r" instead of "data".
parent d294bfdd
No related branches found
No related tags found
No related merge requests found
......@@ -199,6 +199,7 @@ size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len
if (c == CR) {
EMIT_DATA_CB(header_value, buf + mark, i - mark);
p->state = s_header_value_almost_done;
break;
}
if (is_last)
EMIT_DATA_CB(header_value, buf + mark, (i - mark) + 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment