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.
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)