]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: don't emit a send-name-header in conn error or disconnect states
authorWilly Tarreau <w@1wt.eu>
Wed, 5 Jun 2019 13:29:38 +0000 (15:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Jun 2019 14:36:19 +0000 (16:36 +0200)
The test for the send-name-header field used to cover all states between
SI_ST_CON and SI_ST_CLO, which include SI_ST_CER and SI_ST_DIS. Trying to
send a header in these states makes no sense at all, so let's fix this.
This should have no visible impact so no backport is needed.

src/stream.c

index 0623ee8d4bcfa0407115c26822ae83e746f1ef84..bf1dd123e95ff629afb06e423893d30ebaf23198 100644 (file)
@@ -2429,7 +2429,7 @@ redo:
 
                        /* Now we can add the server name to a header (if requested) */
                        /* check for HTTP mode and proxy server_name_hdr_name != NULL */
-                       if ((si_b->state >= SI_ST_CON) && (si_b->state < SI_ST_CLO) &&
+                       if ((si_b->state == SI_ST_CON || si_b->state == SI_ST_EST) &&
                            (s->be->server_id_hdr_name != NULL) &&
                            (s->be->mode == PR_MODE_HTTP) &&
                            objt_server(s->target)) {