]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream: Only allow L7 retries when using HTTP.
authorOlivier Houchard <cognet@ci0.org>
Wed, 13 May 2020 17:07:20 +0000 (19:07 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 13 May 2020 17:07:20 +0000 (19:07 +0200)
Only allow L7 retries when using HTTP, it only really makes sense for HTTP,
anyway, and as the L7 retries code assume the message will be HTX, it will
crash when used with mode TCP.
This should fix github issue #627.

This should be backported to 2.1 and 2.0.

src/stream.c

index f7ed26f30c65d38eefe069bcbd31609c18aec1a4..4fa41a71d995b477a505a0b980d96d2e6185dc00 100644 (file)
@@ -2068,6 +2068,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state)
                                si_b->state = SI_ST_REQ; /* new connection requested */
                                si_b->conn_retries = s->be->conn_retries;
                                if ((s->be->retry_type &~ PR_RE_CONN_FAILED) &&
+                                   (s->be->mode == PR_MODE_HTTP) &&
                                    !(si_b->flags & SI_FL_D_L7_RETRY))
                                        si_b->flags |= SI_FL_L7_RETRY;
                        }