BUG/MINOR: http-ana: Send the right error if max retries is reached on L7 retry
This bug was introduced by the previous commit (9f5382e45 Revert "MEDIUM:
http-ana: Deal with L7 retries in HTTP analysers") because I failed the
revert.
On L7 retry, if the maximum connection retries is reached, an error must be
return to the client. Depending the situation, it may be a 502-Bad-Gateway
(empty-response or junk-response), a 504-Gateway-Timeout (response-timeout)
or a 425-Too-Early (0rtt-rejected). But contrary to what the comment says,
the do_l7_retry() function always returns a success.
Note it is not a problem for L7 retries on the response status code because
the stream-interface already takes care to have not reached the maximum
connection retries counter to trigger a L7 retry.
This patch must be backported to 2.4 because the commit must also be
backported to 2.4.
diff --git a/src/http_ana.c b/src/http_ana.c
index ef9ee65..ee0422e 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -1269,7 +1269,7 @@
si->conn_retries--;
if (si->conn_retries < 0)
- goto no_retry;
+ return -1;
if (objt_server(s->target)) {
if (s->flags & SF_CURR_SESS) {
@@ -1307,7 +1307,6 @@
DBG_TRACE_DEVEL("perform a L7 retry", STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, s->txn);
- no_retry:
b_reset(&res->buf);
co_set_data(res, 0);
return 0;