]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: streams: Make sur SI_FL_L7_RETRY is set before attempting a retry.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 10 May 2019 15:48:28 +0000 (17:48 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 10 May 2019 15:48:59 +0000 (17:48 +0200)
In a few cases, we'd just check if the backend is configured to do retries,
and not if it's still allowed on the stream_interface.
The SI_FL_L7_RETRY flag could have been removed because we failed to allocate
a buffer, or because the request was too big to fit in a single buffer,
so make sure it's there before attempting a retry.

src/proto_htx.c

index b99b9cf9b38a9e9ee71c8c32537ba3608c493a90..e7341c1ae1261ca46ff030b3f5450d2ddf834972 100644 (file)
@@ -1528,6 +1528,7 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
                         */
                        if (conn->err_code == CO_ER_SSL_EARLY_FAILED) {
                                if ((s->be->retry_type & PR_RE_EARLY_ERROR) &&
+                                   (si_b->flags & SI_FL_L7_RETRY) &&
                                    do_l7_retry(s, si_b) == 0)
                                        return 0;
                                txn->status = 425;
@@ -1817,6 +1818,7 @@ int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
                health_adjust(__objt_server(s->target), HANA_STATUS_HTTP_HDRRSP);
        }
        if ((s->be->retry_type & PR_RE_JUNK_REQUEST) &&
+           (si_b->flags & SI_FL_L7_RETRY) &&
            do_l7_retry(s, si_b) == 0)
                return 0;
        txn->status = 502;