From: Christopher Faulet Date: Sat, 2 May 2020 07:21:24 +0000 (+0200) Subject: BUG/MEDIUM: mux-fcgi: Fix wrong test on FCGI_CF_KEEP_CONN in fcgi_detach() X-Git-Tag: v2.1.5~32 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=e5bcdafdb002d50a2bdcf0df395504cf697bbe2b;p=haproxy-2.1.git BUG/MEDIUM: mux-fcgi: Fix wrong test on FCGI_CF_KEEP_CONN in fcgi_detach() When a stream is detached from its connection, we try to move the connection in an idle list to keep it opened, the session one or the server one. But it must only be done if there is no connection error and if we want to keep it open. This last statement is true if FCGI_CF_KEEP_CONN flag is set. But the test is inverted at the stage. This patch must be backported to 2.1. (cherry picked from commit 9bcd973a818bcc737f627ef9cef211b33229f18f) Signed-off-by: Christopher Faulet --- diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index d64d748..1dfe060 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -3494,7 +3494,7 @@ static void fcgi_detach(struct conn_stream *cs) fcgi_strm_destroy(fstrm); if (!(fconn->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_RD_SH|CO_FL_SOCK_WR_SH)) && - !(fconn->flags & FCGI_CF_KEEP_CONN)) { + (fconn->flags & FCGI_CF_KEEP_CONN)) { if (!fconn->conn->owner) { fconn->conn->owner = sess; if (!session_add_conn(sess, fconn->conn, fconn->conn->target)) {