In order to parse H1 trailers, h1_parse_msg_tlrs() builds a local dummy
h1m that sets H1_MF_HDRS_ONLY and calls h1_headers_to_hdr_list() which
directly jumps to plain headers parsing. However, this latter function
has no way to adjust its error processing on header or trailer because
the information regarding the fact that headers or trailers are being
parsed isn't present. Currently this is not a problem but it will become
in order to refine error processing to have separate rules for headers
and trailers.
This patch sets the dummy h1m's state to H1_MSG_TRAILERS so that the
called function can safely rely on it. All other callers pass a real
message with a valid state, so it will be possible to check h1m->state
during error processing to figure if the function is in the process of
parsing trailers or headers.
if (b_head(srcbuf) + b_data(srcbuf) > b_wrap(srcbuf))
b_slow_realign_ofs(srcbuf, trash.area, 0);
+ tlr_h1m.state = H1_MSG_TRAILERS;
tlr_h1m.flags = (H1_MF_NO_PHDR|H1_MF_HDRS_ONLY);
tlr_h1m.err_pos = h1m->err_pos;
/* The buffer was realigned above, so <b_stop()> safely points to the