]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sample: postresolve sink names in debug() converter
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Oct 2024 09:37:36 +0000 (11:37 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 10 Oct 2024 14:55:15 +0000 (16:55 +0200)
debug() converter used to resolve sink names during parsing time. Because
of this, we were unable to specify sink names that were defined after
the debug() converter was placed.

Like in the previous commit, let's implement proper postparsing for the
debug() converter, in order to be able to use sink names that are about
to be defined later in the config file.

src/sample.c

index 087367da356030c500b93bc53ba7f66cedac63f5..1951d7b6b85882b52dfca2cd09d2060f65356e0d 100644 (file)
@@ -1819,9 +1819,9 @@ static int smp_check_debug(struct arg *args, struct sample_conv *conv,
        if (args[1].type == ARGT_STR)
                name = args[1].data.str.area;
 
-       sink = sink_find(name);
+       sink = sink_find_early(name, "debug converter", file, line);
        if (!sink) {
-               memprintf(err, "No such sink '%s'", name);
+               memprintf(err, "Memory error while setting up sink '%s'", name);
                return 0;
        }