Skip to content

Commit

Permalink
BUG/MEDIUM: stream: Don't call mux .ctl() callback if not implemented
Browse files Browse the repository at this point in the history
The commit 5ff7d22 ("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 haproxy#2095. It must be
backported as far as 2.2, with the commit above.
  • Loading branch information
capflam committed Nov 14, 2023
1 parent d76fa37 commit 691f4cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 691f4cf

Please sign in to comment.