From 405567c12574aaa6b5902c494f4477af8a32c0b2 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Mon, 18 Sep 2023 17:21:19 +0200 Subject: [PATCH] MINOR: sink: don't rely on forward_px to init sink forwarding Instead, we check if at least one sft has been registered into the sink, if it is the case, then we need to init the forwarding for the sink. --- src/sink.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sink.c b/src/sink.c index a75cb7ed2..ae64b5537 100644 --- a/src/sink.c +++ b/src/sink.c @@ -894,10 +894,11 @@ static int sink_finalize(struct sink *sink) sink->sft = sft; srv = srv->next; } - if (sink_init_forward(sink) == 0) { - ha_alert("error when trying to initialize sink buffer forwarding.\n"); - err_code |= ERR_ALERT | ERR_FATAL; - } + } + /* init forwarding if at least one sft is registered */ + if (sink->sft && sink_init_forward(sink) == 0) { + ha_alert("error when trying to initialize sink buffer forwarding.\n"); + err_code |= ERR_ALERT | ERR_FATAL; } } return err_code;