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.
This commit is contained in:
Christopher Faulet 2018-09-25 13:59:46 +02:00 committed by Willy Tarreau
parent 315b39c391
commit ff08a92797
1 changed files with 1 additions and 1 deletions

View File

@ -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