From 19ecf71b60f34801c11d6006dc2d88262ecd86ea Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 5 Jun 2019 15:29:38 +0200 Subject: [PATCH] BUG/MINOR: stream: don't emit a send-name-header in conn error or disconnect states 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index 0623ee8d4b..bf1dd123e9 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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)) { -- 2.47.3