From: Christopher Faulet Date: Tue, 25 Sep 2018 11:59:46 +0000 (+0200) Subject: MINOR: h1: Add EOH marker during headers parsing X-Git-Tag: v1.9-dev4~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff08a92797e4568039408aac2c0e1c3e5fa38738;p=thirdparty%2Fhaproxy.git MINOR: h1: Add EOH marker during headers parsing When headers parsing ends, a pseudo header with an empty name and an empty value is added to the array of parsed headers to mark its end. It is convenient to loop on this array, but not really useful if we want remove the last header or add a new one, because we don't really know where is the last CRLF (the empty line ending the headers block). So now, instead the name of this pseudo header points on this last CRLF. Its length is still 0 and its value is still empty, so loops on the array remains unchanged. --- diff --git a/src/h1.c b/src/h1.c index b1da880f83..660e7fd2ad 100644 --- a/src/h1.c +++ b/src/h1.c @@ -1433,7 +1433,7 @@ int h1_headers_to_hdr_list(char *start, const char *stop, state = H1_MSG_LAST_LF; goto http_output_full; } - http_set_hdr(&hdr[hdr_count++], ist(""), ist("")); + http_set_hdr(&hdr[hdr_count++], ist2(start+sol, 0), ist("")); } /* reaching here we've parsed the whole message. We may detect