From: Christopher Faulet Date: Fri, 11 Oct 2019 12:22:00 +0000 (+0200) Subject: BUG/MINOR: mux-h1: Capture ignored parsing errors X-Git-Tag: v2.1-dev3~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=486498c630a0678446808107d02f94c48fc6722a;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h1: Capture ignored parsing errors When the option "accept-invalid-http-request" is enabled, some parsing errors are ignored. But the position of the error is reported. In legacy HTTP mode, such errors were captured. So, we now do the same in the H1 multiplexer. If required, this patch may be backported to 2.0 and 1.9. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index ac520a42df..b9b78f0b67 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1191,6 +1191,15 @@ static size_t h1_process_headers(struct h1s *h1s, struct h1m *h1m, struct htx *h goto end; } + if (h1m->err_pos >= 0) { + /* Maybe we found an error during the parsing while we were + * configured not to block on that, so we have to capture it + * now. + */ + TRACE_STATE("Ignored parsing error", H1_EV_RX_DATA|H1_EV_RX_HDRS, h1s->h1c->conn, h1s); + h1_capture_bad_message(h1s->h1c, h1s, h1m, buf); + } + if (!(h1m->flags & H1_MF_RESP)) { h1s->meth = h1sl.rq.meth; if (h1m->state == H1_MSG_TUNNEL) {