BUG/MINOR: mux-h1: Fix the parsing of trailers

Unlike other H1 parsing functions, the 3rd parameter of the function
h1_measure_trailers() is the maximum number of bytes to read. For others
functions, it is the relative offset where to stop the parsing.

This patch must be backported to 1.9.
This commit is contained in:
Christopher Faulet 2019-05-07 10:53:32 +02:00
parent 3b1d004d41
commit 39593e6ae3

View File

@ -1219,7 +1219,7 @@ static size_t h1_process_data(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
if (h1s->flags & H1S_F_HAVE_I_TLR)
goto skip_tlr_parsing;
ret = h1_measure_trailers(buf, *ofs, *ofs + max);
ret = h1_measure_trailers(buf, *ofs, max);
if (ret > data_space)
ret = (htx_is_empty(htx) ? -1 : 0);
if (ret <= 0)