]> git.kaiwu.me - haproxy.git/commit
MINOR: server: improve parsing error for server-template
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Jul 2026 08:39:54 +0000 (10:39 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Jul 2026 09:39:30 +0000 (11:39 +0200)
commit94024a60dc197b26a13751a6a0eaa3071f023cfa
tree47ffeb8a7a5cda1b5a57a06dbd554a3b743d09fe
parent26e74f140151d7c1152d3e162dbdb95857a8aac5
MINOR: server: improve parsing error for server-template

When parsing a server configuration line, a global context is set to the
current server instance. This allows to automatically prefix any
warning/error messages by the server name. This prefix is generated via
generate_usermsgs_ctx_str().

The output was not useful for server-template lines as server <id> is
NULL for them. Thus, this patch improves generate_usermsgs_ctx_str() to
identify a server-template. Now, a dedicated 'server-template' prefix is
generated, with <tmpl_info.prefix> used instead of NULL <id> field.

* Example of a previous error message :
[ALERT]    (39934) : config : [./hap.cfg:54] : 'server-template be/(null)' : error detected while parsing [...]
* Example of a new error message :
[ALERT]    (40205) : config : [./hap.cfg:54] : 'server-template be/local' : error detected while parsing [...]
src/errors.c