1 commit 9fa93f6220a374f724491fd781d44d31f307671f
2 Author: Christopher Faulet <cfaulet@haproxy.com>
3 Date: Fri Jun 28 17:41:42 2019 +0200
5 BUG/MEDIUM: mux-h1: Always release H1C if a shutdown for writes was reported
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.
13 This patch must be backported to 2.0 and 1.9. It is related to the issue #136
16 (cherry picked from commit 3ac0f43020e1cd77198020201e4e482a1c2ef8ac)
17 Signed-off-by: Willy Tarreau <w@1wt.eu>
19 diff --git a/src/mux_h1.c b/src/mux_h1.c
20 index 3d2bd8b8..e497e6f6 100644
23 @@ -2192,9 +2192,9 @@ static void h1_detach(struct conn_stream *cs)
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)
35 tasklet_wakeup(h1c->wait_event.tasklet);