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.
This commit is contained in:
Aurelien DARRAGON 2023-09-18 17:21:19 +02:00 committed by Christopher Faulet
parent 3c53f6cb76
commit 405567c125

View File

@ -894,10 +894,11 @@ static int sink_finalize(struct sink *sink)
sink->sft = sft; sink->sft = sft;
srv = srv->next; srv = srv->next;
} }
if (sink_init_forward(sink) == 0) { }
ha_alert("error when trying to initialize sink buffer forwarding.\n"); /* init forwarding if at least one sft is registered */
err_code |= ERR_ALERT | ERR_FATAL; 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; return err_code;