MINOR: server: ensure server postparse tasks are run for dynamic servers

commit 29b76cae4 ("BUG/MEDIUM: server/log: "mode log" after server
keyword causes crash") introduced some postparsing checks/tasks for
server

Initially they were mainly meant for "mode log" servers postparsing, but
we already have a check dedicated to "tcp/http" servers (ie: only tcp
proto supported)

However when dynamic servers are added they bypass _srv_postparse() since
the REGISTER_POST_SERVER_CHECK() is only executed for servers defined in
the configuration.

To ensure consistency between dynamic and static servers, and ensure no
post-check init routine is missed, let's manually invoke _srv_postparse()
after creating a dynamic server added via the cli.
This commit is contained in:
Aurelien DARRAGON 2025-05-07 23:50:46 +02:00
parent 976e0bd32f
commit f03e999912

View File

@ -5883,6 +5883,10 @@ static int cli_parse_add_server(char **args, char *payload, struct appctx *appct
if (errcode)
goto out;
errcode = _srv_postparse(srv);
if (errcode)
goto out;
/* A dynamic server does not currently support resolution.
*
* Initialize it explicitly to the "none" method to ensure no