From 691f4cf449c700c7abedb845557d39cd788264b0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 14 Nov 2023 19:18:53 +0100 Subject: [PATCH] BUG/MEDIUM: stream: Don't call mux .ctl() callback if not implemented The commit 5ff7d2276 ("BUG/MEDIUM: stream: Properly handle abortonclose when set on backend only") introduced a regression. Not all multiplexer implement the .ctl() callback function. Thus we must be sure this callback function is defined first to call it. This patch should fix a crash reported by Tristan in the issue #2095. It must be backported as far as 2.2, with the commit above. --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index 14060b2e9..497e1d83f 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2296,7 +2296,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) if (s->be->options & PR_O_ABRT_CLOSE) { struct connection *conn = sc_conn(scf); - if (conn) + if (conn && conn->mux && conn->mux->ctl) conn->mux->ctl(conn, MUX_SUBS_RECV, NULL); } }