]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cfgparse-global: move tune options in global keywords list
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 14 Aug 2024 16:17:11 +0000 (18:17 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 20 Aug 2024 17:16:32 +0000 (19:16 +0200)
commit55309592dbc27b70436a5610e20431255eb06cde
tree1a9ee16d25166a57fbb38c5a0588acc8d53b9ad1
parentc46497f16f9e3c63f3ae9ff53e775de36105a53c
MINOR: cfgparse-global: move tune options in global keywords list

In order to clean up cfg_parse_global() and to add the support of the new
MODE_DISCOVERY in configuration parsing, let's move the keywords related to
tune options into the global keywords list and let's add for them two dedicated
parsers. Tune options keywords are sorted between two parsers in dependency of
parameters number, which a given tune option needs.

tune options parser is called by section parser and follows the common API, i.e.
it returns -1 on failure, 0 on success and 1 on recoverable error. In case of
recoverable error we've previously returned ERR_ALERT (0x10) and we have emitted
an alert message at startup. Section parser treats all rc > 0 as ERR_WARN. So in
case, if some tune option was set twice in the global section, tune
options parser will return 1 (in order to respect the common API), section
parser will treat this as ERR_WARN and a warning message will be emitted during
process startup instead of alert, as it was before.
src/cfgparse-global.c