140ec71db54d4e45970814fff5407095c80d9a9a
[feed/packages.git] /
1 commit 9fa93f6220a374f724491fd781d44d31f307671f
2 Author: Christopher Faulet <cfaulet@haproxy.com>
3 Date: Fri Jun 28 17:41:42 2019 +0200
4
5 BUG/MEDIUM: mux-h1: Always release H1C if a shutdown for writes was reported
6
7 We must take care of this when the stream is detached from the
8 connection. Otherwise, on the server side, the connexion is inserted in the list
9 of idle connections of the session. But when reused, because the shutdown for
10 writes was already catched, nothing is sent to the server and the session is
11 blocked with a freezed connection.
12
13 This patch must be backported to 2.0 and 1.9. It is related to the issue #136
14 reported on Github.
15
16 (cherry picked from commit 3ac0f43020e1cd77198020201e4e482a1c2ef8ac)
17 Signed-off-by: Willy Tarreau <w@1wt.eu>
18
19 diff --git a/src/mux_h1.c b/src/mux_h1.c
20 index 3d2bd8b8..e497e6f6 100644
21 --- a/src/mux_h1.c
22 +++ b/src/mux_h1.c
23 @@ -2192,9 +2192,9 @@ static void h1_detach(struct conn_stream *cs)
24 }
25 }
26
27 - /* We don't want to close right now unless the connection is in error */
28 - if ((h1c->flags & (H1C_F_CS_ERROR|H1C_F_CS_SHUTDOWN|H1C_F_UPG_H2C)) ||
29 - (h1c->conn->flags & CO_FL_ERROR) || !h1c->conn->owner)
30 + /* We don't want to close right now unless the connection is in error or shut down for writes */
31 + if ((h1c->flags & (H1C_F_CS_ERROR|H1C_F_CS_SHUTW_NOW|H1C_F_CS_SHUTDOWN|H1C_F_UPG_H2C)) ||
32 + (h1c->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_WR_SH)) || !h1c->conn->owner)
33 h1_release(h1c);
34 else {
35 tasklet_wakeup(h1c->wait_event.tasklet);