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.
This commit is contained in:
Willy Tarreau 2019-06-05 15:29:38 +02:00
parent 975b155ebb
commit 19ecf71b60

View File

@ -2429,7 +2429,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state)
/* 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)) {