]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: expose node typecast in lf_buildctx struct
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 25 Apr 2024 16:52:57 +0000 (18:52 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 26 Apr 2024 16:39:31 +0000 (18:39 +0200)
Store node->typecast setting inside lf_buildctx struct so that encoding
functions may benefit from it.

src/log.c

index a5f72faaffba0aae1cdb3526e98cb2de453163dd..5876a773f0ebde8db63881eb8e89fee022a55e9a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1731,6 +1731,7 @@ int get_log_facility(const char *fac)
 
 struct lf_buildctx {
        int options; /* LOG_OPT_* options */
+       int typecast;/* same as logformat_node->typecast */
        int in_text; /* inside variable-length text */
 };
 
@@ -1742,11 +1743,15 @@ static inline void lf_buildctx_prepare(struct lf_buildctx *ctx,
                                        const struct logformat_node *node)
 {
        ctx->options = g_options;
+       ctx->typecast = SMP_T_SAME; /* default */
        if (node) {
                /* per-node options are only considered if not already set
                 * globally
                 */
                ctx->options |= node->options;
+
+               /* consider node's typecast setting */
+               ctx->typecast = node->typecast;
        }
 }