]> git.kaiwu.me - haproxy.git/commit
MINOR: errors: further improve parsing error for server-template
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 31 Jul 2026 12:09:28 +0000 (14:09 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 3 Aug 2026 09:11:19 +0000 (11:11 +0200)
commit1a91fe28291f20362e9ef894227fd9d987a35a4b
tree0f62cabfb17e7e0584099da732c6c3e6016d4418
parentea5e5c3c5c7b79c0e54796557416c46e3e51c884
MINOR: errors: further improve parsing error for server-template

The following patch improved error messages for server-template lines.
This properly used <tmpl_info.prefix> instead of the <id> field for
them, which prevents to display an empty string.

  94024a60dc197b26a13751a6a0eaa3071f023cfa
  MINOR: server: improve parsing error for server-template

This patch relied on server-template instance detection by checking if
<id> field is NULL. However, this is not appropriate once a
server-template has its ID assigned during _srv_parse_tmpl_init(). The
expanded name is displayed, which can be a misleading information as
this is not present directly in the configuration.

This patch fixes this by now detecting a server-template by checking if
its <tmpl_info.prefix> is non NULL. Thus, a server-template remains
detected as such even after its ID has been generating. Its template
name is used on error messages instead of the expanded prefix.
src/errors.c