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.

(cherry picked from commit dd6f0b1a74fb1241d276484f3c4aced513a95b78)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

[Cf: The legacy code was also fixed the same way. The patch must be backported
to lower versions, as far as 1.7. In 1.9, it will be applied on the mentionned
commit, but for others, only this one, for the legacy part, will be necessary. ]
diff --git a/src/proto_htx.c b/src/proto_htx.c
index e960cf1..7bae526 100644
--- a/src/proto_htx.c
+++ b/src/proto_htx.c
@@ -1517,6 +1517,8 @@
 			}
 
 			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.
@@ -1554,6 +1556,8 @@
 			}
 
 			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;
 			htx_reply_and_close(s, txn->status, htx_error_message(s));
@@ -1573,6 +1577,8 @@
 				_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;
 			htx_reply_and_close(s, txn->status, htx_error_message(s));
 
@@ -1603,6 +1609,8 @@
 			}
 
 			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;
 			htx_reply_and_close(s, txn->status, htx_error_message(s));
@@ -1621,6 +1629,8 @@
 
 			_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;