From eeec6b9cd3e31b9863ecf1fc502c17e7d08487bd Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Mon, 18 Nov 2024 19:10:48 +0900 Subject: [PATCH] in_forward: Recreate connection when resumed Signed-off-by: Hiroshi Hatake --- plugins/in_forward/fw.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/in_forward/fw.c b/plugins/in_forward/fw.c index 20c3946b5ff..1b4b3436e9d 100644 --- a/plugins/in_forward/fw.c +++ b/plugins/in_forward/fw.c @@ -383,8 +383,25 @@ static void in_fw_pause(void *data, struct flb_config *config) } static void in_fw_resume(void *data, struct flb_config *config) { + struct flb_connection *connection; + struct fw_conn *conn; struct flb_in_fw_config *ctx = data; if (config->is_running == FLB_TRUE) { + connection = flb_downstream_conn_get(ctx->downstream); + + if (connection == NULL) { + flb_plg_error(ctx->ins, "could not accept new connection"); + + return; + } + conn = fw_conn_add(connection, ctx); + + if (!conn) { + flb_plg_error(ctx->ins, "could not add connection"); + + return; + } + ctx->is_paused = FLB_FALSE; flb_input_collector_resume(ctx->coll_fd, ctx->ins); }