]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: sink: implement sink_find_early()
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Oct 2024 09:31:59 +0000 (11:31 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Oct 2024 14:55:15 +0000 (16:55 +0200)
commit1bdf6e884a5a205b3d98d217c3d1cc0982e10208
treeb26afabe00be7e0f85748964787a249aa211d653
parentba7c03c18ef9d6a5cdf7cf9a6f2840723b5e2e59
MEDIUM: sink: implement sink_find_early()

sink_find_early() is a convenient function that can be used instead of
sink_find() during parsing time in order to try to find a matching
sink even if the sink is not defined yet.

Indeed, if the sink is not defined, sink_find_early() will try to create
it and mark it as forward-declared. It will also save informations from
the caller to better identify it in case of errors.

If the sink happens to be found in the config, it will transition from
forward-declared type to its final type. Else, it means that the sink
was not found in the config, in this case, during postresolve, we raise
an error to indicate that the sink was not found in the configuration.

It should help solve postresolving issue with rings, because for now only
log targets implement proper ring postresolving.. but rings may be used
at different places in the code, such as debug() converter or in "traces"
section.
include/haproxy/sink-t.h
include/haproxy/sink.h
src/sink.c