]> git.kaiwu.me - haproxy.git/commit
MINOR: cfgparse: expose the keyword modifier to the keyword parsers
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Oct 2026 14:06:44 +0000 (16:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 07:31:07 +0000 (09:31 +0200)
commit673276c9e6cfcb3372a05dc53139fdca43a9cee3
treee5186bb566a5f61fbffc424bbe201e7271048e15
parentc5eff44987155c7c1e9e577b168a5dc4083d08bc
MINOR: cfgparse: expose the keyword modifier to the keyword parsers

Section parsers receive the keyword modifier ("no" or "default") found in
front of the keyword as their last argument, but the keyword parsers which
are registered in a cfg_kw_list only receive the arguments, the file name
and the line number. As a consequence, a keyword supporting negation such
as "busy-polling" cannot be moved out of a section parser.

Let's just expose the modifier of the line being parsed in a new global
variable, cfg_curr_kwm, which is set for each new line in readcfgfile()
and reset once the file is completely parsed. This way the few keyword
parsers which are interested in it may consult it, the same way they
already consult "file" and "line".
include/haproxy/cfgparse.h
src/cfgparse.c