mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
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.
This commit is contained in:
parent
9f5382e452
commit
552601d5fd
@ -1269,7 +1269,7 @@ static __inline int do_l7_retry(struct stream *s, struct stream_interface *si)
|
||||
|
||||
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 @@ static __inline int do_l7_retry(struct stream *s, struct stream_interface *si)
|
||||
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user