From dd6f0b1a74fb1241d276484f3c4aced513a95b78 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 1 Apr 2020 08:14:16 +0200 Subject: [PATCH] BUG/MINOR: http-ana: Reset request analysers on error when waiting for response This bug was supposed to be fixed by the commit f6df2b4a ("BUG/MINOR: http-ana: Reset request analysers on a response side error"). It is a backported patch from the 2.2. But, while it is enough on the 2.2, it is not on 2.1 and lower. For these versions, the error handling is not grouped at the end of analysers. At many places, when we are waiting for a response, several errors are immediately returned. For all of these, the same fix must be applied. The patch was directly introduced on 2.1, there is no upstream commit ID for this patch. It must be backported everywhere the commit f6df2b4a is. --- src/http_ana.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/http_ana.c b/src/http_ana.c index 93b7d5c..5705874 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1486,6 +1486,8 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) } rep->analysers &= AN_RES_FLT_END; + s->req.analysers &= AN_REQ_FLT_END; + rep->analyse_exp = TICK_ETERNITY; txn->status = 502; /* Check to see if the server refused the early data. @@ -1531,6 +1533,8 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) } rep->analysers &= AN_RES_FLT_END; + s->req.analysers &= AN_REQ_FLT_END; + rep->analyse_exp = TICK_ETERNITY; txn->status = 504; s->si[1].flags |= SI_FL_NOLINGER; http_reply_and_close(s, txn->status, http_error_message(s)); @@ -1552,6 +1556,8 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) _HA_ATOMIC_ADD(&__objt_server(s->target)->counters.cli_aborts, 1); rep->analysers &= AN_RES_FLT_END; + s->req.analysers &= AN_REQ_FLT_END; + rep->analyse_exp = TICK_ETERNITY; txn->status = 400; http_reply_and_close(s, txn->status, http_error_message(s)); @@ -1587,6 +1593,8 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) } rep->analysers &= AN_RES_FLT_END; + s->req.analysers &= AN_REQ_FLT_END; + rep->analyse_exp = TICK_ETERNITY; txn->status = 502; s->si[1].flags |= SI_FL_NOLINGER; http_reply_and_close(s, txn->status, http_error_message(s)); @@ -1607,6 +1615,8 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) _HA_ATOMIC_ADD(&s->be->be_counters.failed_resp, 1); rep->analysers &= AN_RES_FLT_END; + s->req.analysers &= AN_REQ_FLT_END; + rep->analyse_exp = TICK_ETERNITY; if (!(s->flags & SF_ERR_MASK)) s->flags |= SF_ERR_CLICL; -- 1.7.10.4