From 3ac0f43020e1cd77198020201e4e482a1c2ef8ac Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 28 Jun 2019 17:41:42 +0200 Subject: [PATCH] BUG/MEDIUM: mux-h1: Always release H1C if a shutdown for writes was reported We must take care of this when the stream is detached from the connection. Otherwise, on the server side, the connexion is inserted in the list of idle connections of the session. But when reused, because the shutdown for writes was already catched, nothing is sent to the server and the session is blocked with a freezed connection. This patch must be backported to 2.0 and 1.9. It is related to the issue #136 reported on Github. --- src/mux_h1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mux_h1.c b/src/mux_h1.c index 3d2bd8b877..e497e6f68d 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2192,9 +2192,9 @@ static void h1_detach(struct conn_stream *cs) } } - /* We don't want to close right now unless the connection is in error */ - if ((h1c->flags & (H1C_F_CS_ERROR|H1C_F_CS_SHUTDOWN|H1C_F_UPG_H2C)) || - (h1c->conn->flags & CO_FL_ERROR) || !h1c->conn->owner) + /* We don't want to close right now unless the connection is in error or shut down for writes */ + if ((h1c->flags & (H1C_F_CS_ERROR|H1C_F_CS_SHUTW_NOW|H1C_F_CS_SHUTDOWN|H1C_F_UPG_H2C)) || + (h1c->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_WR_SH)) || !h1c->conn->owner) h1_release(h1c); else { tasklet_wakeup(h1c->wait_event.tasklet); -- 2.39.5