]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: cfgparse-listen: complete the list of options for the suggestions
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Sep 2026 14:37:58 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 07:22:33 +0000 (09:22 +0200)
commit3fac6c417b2717acc303d4a54dd37b0871571ed1
tree8d46b3c10a846a7dee0d41ceb034f50c82ae9bd2
parent5605269b1a3a6100ae3ccbfb013bbbb2553c8ee1
BUG/MINOR: cfgparse-listen: complete the list of options for the suggestions

The options which need a dedicated parsing are not described in the
cfg_opts* arrays, so they are listed in common_options[] in order to be
proposed as a suggestion when one of them is mistyped. That list was
incomplete and was missing "accept-invalid-http-request",
"accept-invalid-http-response", "forceclose",
"http-restrict-req-hdr-names", "http-tunnel", "http_proxy", "httpslog"
and "use-small-buffers", and it spelled "originalto" as "original-to",
so none of these ever got suggested:

  $ printf 'backend b\noption originalt\n' | ./haproxy -c -f /dev/stdin
  [ALERT] : parsing [/dev/stdin:2] : unknown option 'originalt'.

In addition "spop-check" was listed unconditionally while the option
only exists when SPOE is enabled, so a build spoe would propose it
but fail to recognize it:

  [ALERT] : unknown option 'spop-chek'; did you mean 'spop-check' maybe ?
  ...
  [ALERT] : unknown option 'spop-check'; did you mean 'tcp-check' maybe ?

The list is now sorted, complete and conditional where needed, and it
received a comment saying that it must be kept in sync with the options.

Note that the existing cfg_opts* already handle a few special cases like
disabled or obsolete options. Maybe we could extend it to also support
special options that are just not parsed there and must appear somewhere
else. This could even further simplify the parser by preserving PR_CAP_*
to let the main parser handle incompatibilities.

This may be backported to all supported versions.
src/cfgparse-listen.c