diff --git a/src/flb_plugin_proxy.c b/src/flb_plugin_proxy.c index e7ab2429455..ce4c8332121 100644 --- a/src/flb_plugin_proxy.c +++ b/src/flb_plugin_proxy.c @@ -183,13 +183,13 @@ static void flb_proxy_input_cb_resume(void *data, struct flb_config *config) } static void flb_plugin_proxy_destroy(struct flb_plugin_proxy *proxy); -static int flb_proxy_output_cb_exit(void *data, struct flb_config *config) +static int flb_proxy_output_cb_exit(void *data, void *out_context) { struct flb_output_plugin *instance = data; struct flb_plugin_proxy *proxy = (instance->proxy); - + struct flb_plugin_proxy_context *ctx = out_context; if (proxy->def->proxy == FLB_PROXY_GOLANG) { - proxy_go_output_destroy(proxy->data); + proxy_go_output_destroy(ctx, proxy->data); } flb_plugin_proxy_destroy(proxy); return 0; diff --git a/src/proxy/go/go.c b/src/proxy/go/go.c index 1568835b221..c419d0b508c 100644 --- a/src/proxy/go/go.c +++ b/src/proxy/go/go.c @@ -145,7 +145,7 @@ int proxy_go_output_flush(struct flb_plugin_proxy_context *ctx, return ret; } -int proxy_go_output_destroy(void *data) +int proxy_go_output_destroy(struct flb_plugin_proxy_context *ctx, void *data) { int ret = 0; struct flbgo_output_plugin *plugin; @@ -154,7 +154,7 @@ int proxy_go_output_destroy(void *data) flb_debug("[GO] running exit callback"); if (plugin->cb_exit_ctx) { - ret = plugin->cb_exit_ctx(plugin->context->remote_context); + ret = plugin->cb_exit_ctx(ctx->remote_context); } else if (plugin->cb_exit) { ret = plugin->cb_exit(); diff --git a/src/proxy/go/go.h b/src/proxy/go/go.h index 1cc0cc141e7..256b9bd8db2 100644 --- a/src/proxy/go/go.h +++ b/src/proxy/go/go.h @@ -56,7 +56,7 @@ int proxy_go_output_init(struct flb_plugin_proxy *proxy); int proxy_go_output_flush(struct flb_plugin_proxy_context *ctx, const void *data, size_t size, const char *tag, int tag_len); -int proxy_go_output_destroy(void *data); +int proxy_go_output_destroy(struct flb_plugin_proxy_context *ctx, void *data); int proxy_go_input_register(struct flb_plugin_proxy *proxy, struct flb_plugin_proxy_def *def);