]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sink: Add a ref to sink in the sink_forward_target structure
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 May 2022 12:50:09 +0000 (14:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 May 2022 14:13:22 +0000 (16:13 +0200)
This change is required to be able to refactor the init stage of appctx. It
is now possible to directly get the sink from a forward target.

include/haproxy/sink-t.h
src/sink.c

index 399d87a4ba3ad7a0afdc613a5a1ff80a22f4035d..a0de3d15a1559b43c9b812c192de1887413e7cf2 100644 (file)
@@ -40,6 +40,7 @@ struct sink_forward_target {
        struct server *srv;    // used server
        struct appctx *appctx; // appctx of current session
        size_t ofs;            // ring buffer reader offset
+       struct sink *sink;     // the associated sink
        struct sink_forward_target *next;
        __decl_thread(HA_SPINLOCK_T lock); // lock to protect current struct
 };
index 59391859ee107a0f0968a9fa4fa6bcaa95eeb6b8..681f363f828ca43add9533d8d0891e9840db4246 100644 (file)
@@ -1005,6 +1005,7 @@ struct sink *sink_new_from_logsrv(struct logsrv *logsrv)
        /* insert into sink_forward_targets
         * list into sink
         */
+       sft->sink = sink;
        sft->next = sink->sft;
        sink->sft = sft;