Skip to content

Commit

Permalink
in_forward: Recreate connection when resumed
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Nov 18, 2024
1 parent 600b5a9 commit eeec6b9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/in_forward/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit eeec6b9

Please sign in to comment.