From ff08a92797e4568039408aac2c0e1c3e5fa38738 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 25 Sep 2018 13:59:46 +0200 Subject: [PATCH] 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. --- src/h1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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