From: Christopher Faulet Date: Wed, 1 Apr 2020 06:14:16 +0000 (+0200) Subject: BUG/MINOR: http-ana: Reset request analysers on error when waiting for response X-Git-Tag: v2.1.4~2 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=dd6f0b1a74fb1241d276484f3c4aced513a95b78;p=haproxy-2.1.git 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. --- 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;