mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 06:41:32 +02:00
MINOR: mux-h1: Force close mode for proxy responses with an unfinished request
When a response generated by HAProxy is handled by the mux H1, if the corresponding request has not fully been received, the close mode is forced. Thus, the client is notified the connection will certainly be closed abruptly, without waiting the end of the request.
This commit is contained in:
parent
065118166c
commit
04f8919a78
11
src/mux_h1.c
11
src/mux_h1.c
@ -1671,9 +1671,14 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun
|
|||||||
last_lf:
|
last_lf:
|
||||||
h1m->state = H1_MSG_LAST_LF;
|
h1m->state = H1_MSG_LAST_LF;
|
||||||
if (!(h1s->flags & H1S_F_HAVE_O_CONN)) {
|
if (!(h1s->flags & H1S_F_HAVE_O_CONN)) {
|
||||||
/* There is no "Connection:" header and
|
/* If the reply comes from haproxy while the request is
|
||||||
* it the conn_mode must be
|
* not finished, we force the connection close. */
|
||||||
* processed. So do it */
|
if ((chn_htx->flags & HTX_FL_PROXY_RESP) && h1s->req.state != H1_MSG_DONE) {
|
||||||
|
h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;
|
||||||
|
TRACE_STATE("force close mode (resp)", H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the conn_mode must be processed. So do it */
|
||||||
n = ist("connection");
|
n = ist("connection");
|
||||||
v = ist("");
|
v = ist("");
|
||||||
h1_process_output_conn_mode(h1s, h1m, &v);
|
h1_process_output_conn_mode(h1s, h1m, &v);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user