]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: server: merge srv_update_addr() and srv_update_addr_port() logic
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 11 Dec 2023 09:23:17 +0000 (10:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 13:22:27 +0000 (14:22 +0100)
commitf1f4b93a67994608bfefff94758cdd7d663cc577
treee4625b40321d1c16f1c9d7cd9e754ba814cec5ce
parent2d0c7f59357685d91636b428ff2ace6840325a72
MEDIUM: server: merge srv_update_addr() and srv_update_addr_port() logic

Both functions are performing the similar tasks, except that the _port()
version is doing a bit more work.

In this patch, we add the server_set_inetaddr() function that works like
the srv_update_addr_port() but it takes parsed inputs instead of raw
strings as arguments.

Then, server_set_inetaddr() is used as underlying helper function for
both srv_update_addr() and srv_update_addr_port() to make them easier
to maintain.

Also, helper functions were added:
 - server_set_inetaddr_warn() -> same as server_set_inetaddr() but report
   a warning on updates.
 - server_get_inetaddr() -> fills a struct server_inetaddr from srv

Since the feedback message generation part was slightly reworked, some
minor changes in the way addr:svc_port updates are reported in the logs
or cli messages should be expected (no loss of information though).
include/haproxy/server.h
src/server.c