From: Christopher Faulet Date: Fri, 6 Mar 2026 08:24:29 +0000 (+0100) Subject: BUG/MINOR: backend: Don't get proto to use for webscoket if there is no server X-Git-Tag: v3.4-dev7~128 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=af6b9a0967467b0d74f52e273c33e53d36852599;p=haproxy.git 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. --- 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;