]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: server: make server_set_inetaddr() updater serializable
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 11 Dec 2023 14:06:43 +0000 (15:06 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 13:22:27 +0000 (14:22 +0100)
commit3ac79b504a70705b63a5bc316d3728b5cdd64cb5
treea4779465b87327bdba166d40e0ff62f042d83b6d
parent2f6120d6d47d7f9bf0adfabc95832752a33ceba3
MEDIUM: server: make server_set_inetaddr() updater serializable

server_set_inetaddr() updater argument is a simple char * string
containing infos about the caller responsible for the update.

In this patch, we try to make this argument serializable, that is, make
it so that we can easily export it without having to keep the original
pointer passed by the caller or having to work with strings of variable
lengths.

This was a prerequisite for exposing more updater information through
SERVER_INETADDR event (upcoming patch).

Static strings were simply mapped to a fixed ID that can be converted back
to a string when needed using server_inetaddr_updater_by_to_str(). One
special case one made for the SERVER_INETADDR_UPDATER_DNS_RESOLVER updater
since in this case the updater hint has to be generated from the
corresponding resolver id / nameserver id combination. This was achieved
by saving the nameserver id within the updater struct. Knowing that the
resolver id can be guessed from the server struct directly, it was not
exposed through the updater struct.

This patch depends on:
 - "MINOR: resolvers: add unique numeric id to nameservers"

No functional change should be expected.
include/haproxy/dns-t.h
include/haproxy/server-t.h
include/haproxy/server.h
src/hlua_fcn.c
src/resolvers.c
src/server.c