Skip to content

Commit 0c3de71

Browse files
Jason Keeneedsiper
authored andcommitted
proxy: use flb_plugin_proxy_context when calling into remote plugins
Signed-off-by: Warren Fernandes <[email protected]>
1 parent 038453b commit 0c3de71

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

include/fluent-bit/flb_plugin_proxy.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ struct flb_plugin_proxy {
5757
struct mk_list _head; /* link to parent config->proxies */
5858
};
5959

60+
/* This is the context for proxy plugins */
61+
struct flb_plugin_proxy_context {
62+
/* This context is set by the remote init and is passed to remote flush */
63+
void *remote_context;
64+
/* A proxy ptr is needed to detect the proxy type/lang (OUTPUT/GOLANG) */
65+
struct flb_plugin_proxy *proxy;
66+
};
67+
6068
void *flb_plugin_proxy_symbol(struct flb_plugin_proxy *proxy,
6169
const char *symbol);
6270

src/flb_plugin_proxy.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ static void flb_proxy_cb_flush(void *data, size_t bytes,
4949
struct flb_config *config)
5050
{
5151
int ret = FLB_ERROR;
52-
struct flb_plugin_proxy *p = out_context;
52+
struct flb_plugin_proxy_context *ctx = out_context;
5353
(void) tag_len;
5454
(void) i_ins;
5555
(void) config;
5656

5757
#ifdef FLB_HAVE_PROXY_GO
58-
if (p->proxy == FLB_PROXY_GOLANG) {
58+
if (ctx->proxy->proxy == FLB_PROXY_GOLANG) {
5959
flb_trace("[GO] entering go_flush()");
60-
ret = proxy_go_flush(p, data, bytes, tag, tag_len);
60+
ret = proxy_go_flush(ctx, data, bytes, tag, tag_len);
6161
}
6262
#else
63-
(void) p;
63+
(void) ctx;
6464
#endif
6565

6666
if (ret != FLB_OK && ret != FLB_RETRY && ret != FLB_ERROR) {

0 commit comments

Comments
 (0)