MINOR: sink: Add a ref to sink in the sink_forward_target structure

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.
This commit is contained in:
Christopher Faulet 2022-05-12 14:50:09 +02:00
parent b1e0836ecf
commit 2ae25ea24b
2 changed files with 2 additions and 0 deletions

View 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
};

View 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;