From af6b9a0967467b0d74f52e273c33e53d36852599 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 6 Mar 2026 09:24:29 +0100 Subject: [PATCH] BUG/MINOR: backend: Don't get proto to use for webscoket if there is no server In connect_server(), it is possible to have no server defined (dispatch mode or transparent backend). In that case, we must be carefull to check the srv variable in all calls involving the server. It was not perform at one place, when the protocol to use for websocket is retrieved. This must not be done when there is no server. This patch should fix the first report in #3144. It must be backported to all stable version. --- src/backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 2034b2dd3..428036dde 100644 --- a/src/backend.c +++ b/src/backend.c @@ -2204,7 +2204,7 @@ int connect_server(struct stream *s) */ if (may_start_mux_now) { const struct mux_ops *alt_mux = - likely(!(s->flags & SF_WEBSOCKET)) ? NULL : srv_get_ws_proto(srv); + likely(!(s->flags & SF_WEBSOCKET) || !srv) ? NULL : srv_get_ws_proto(srv); if (conn_install_mux_be(srv_conn, s->scb, s->sess, alt_mux) < 0) { conn_full_close(srv_conn); return SF_ERR_INTERNAL;