From ca5332a9c35bed1f5c40adeaa03fe902d83075fa Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Mon, 23 Feb 2026 17:10:56 +0100 Subject: [PATCH] BUG/MINOR: haterm: cannot reset default "haterm" mode When "mode haterm" was set in a "defaults" section, it could not be overridden in subsequent sections using the "mode" keyword. This is because the proxy stream instantiation callback was not being reset to the default stream_new() value. This could break the stats URI with a configuration such as: defaults mode haterm # ... frontend stats bind :8181 mode http stats uri / This patch ensures the ->stream_new_from_sc() proxy callback is reset to stream_new() when the "mode" keyword is parsed for any mode other than "haterm". No need to backport. --- src/cfgparse-listen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 12d42782e..a9e7c983e 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -669,6 +669,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) err_code |= ERR_ALERT | ERR_FATAL; goto out; } + else { + /* valid mode, non "haterm" mode. + * Possibly restore the ->stream_new_from_sc() callback + * if set by default for "haterm" mode. + */ + curproxy->stream_new_from_sc = stream_new; + } curproxy->mode = mode; if (curproxy->cap & PR_CAP_DEF)