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.
This commit is contained in:
Christopher Faulet 2026-03-06 09:24:29 +01:00
parent bfe5a2c3d7
commit af6b9a0967

View File

@ -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;