From: Willy Tarreau Date: Wed, 5 Jun 2019 13:29:38 +0000 (+0200) Subject: BUG/MINOR: stream: don't emit a send-name-header in conn error or disconnect states X-Git-Tag: v2.0-dev6~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=19ecf71b60f34801c11d6006dc2d88262ecd86ea;p=thirdparty%2Fhaproxy.git 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. --- 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)) {