From: Christopher Faulet Date: Thu, 29 Nov 2018 08:55:22 +0000 (+0100) Subject: MINOR: mux-h1: Change client conn_mode on an explicit close for the response X-Git-Tag: v1.9-dev9~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd44ca6edebcbdfc7707346ccf00c8daa0310c7c;p=thirdparty%2Fhaproxy.git MINOR: mux-h1: Change client conn_mode on an explicit close for the response in h1_set_cli_conn_mode(), on the response path, If the response's connection header is explicitly set to close and if the request is unfinished (state != DONE), then the client connection is marked as WANT_CLO. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index b350e0620e..1681861dda 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -585,7 +585,8 @@ static void h1_set_cli_conn_mode(struct h1s *h1s, struct h1m *h1m) if ((h1s->meth == HTTP_METH_CONNECT && h1s->status == 200) || h1s->status == 101) h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_TUN; - else if (!(h1m->flags & H1_MF_XFER_LEN)) /* no length known => close */ + else if (!(h1m->flags & H1_MF_XFER_LEN) || /* no length known => close */ + (h1m->flags & H1_MF_CONN_CLO && h1s->req.state != H1_MSG_DONE)) /*explicit close and unfinished request */ h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO; } else {