Skip to content

Commit e152ad2

Browse files
committed
api: proxy: custom: Address comments
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 6d6dfcb commit e152ad2

File tree

5 files changed

+3
-14
lines changed

5 files changed

+3
-14
lines changed

include/fluent-bit/flb_api.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ struct flb_api {
3838
/* To preserve ABI, we need to add these APIs after the
3939
* input/output definitions. */
4040
const char *(*custom_get_property) (const char *, struct flb_custom_instance *);
41-
void *(*custom_get_cmt_instance) (struct flb_custom_instance *);
4241
int (*custom_log_check) (struct flb_custom_instance *, int);
4342
};
4443

include/fluent-bit/flb_custom.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ int flb_custom_plugin_property_check(struct flb_custom_instance *ins,
107107
int flb_custom_init_all(struct flb_config *config);
108108
void flb_custom_set_context(struct flb_custom_instance *ins, void *context);
109109
void flb_custom_instance_destroy(struct flb_custom_instance *ins);
110-
#ifdef FLB_HAVE_METRICS
111-
void *flb_custom_get_cmt_instance(struct flb_custom_instance *ins);
112-
#endif
113110
int flb_custom_log_check(struct flb_custom_instance *ins, int l);
114111

115112
#endif

src/flb_api.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ struct flb_api *flb_api_create()
4343
#ifdef FLB_HAVE_METRICS
4444
api->output_get_cmt_instance = flb_output_get_cmt_instance;
4545
api->input_get_cmt_instance = flb_input_get_cmt_instance;
46-
api->custom_get_cmt_instance = flb_custom_get_cmt_instance;
4746
#endif
4847

4948
api->log_print = flb_log_print;

src/flb_custom.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,6 @@ void flb_custom_set_context(struct flb_custom_instance *ins, void *context)
372372
ins->context = context;
373373
}
374374

375-
#ifdef FLB_HAVE_METRICS
376-
void *flb_custom_get_cmt_instance(struct flb_custom_instance *ins)
377-
{
378-
return (void *)ins->cmt;
379-
}
380-
#endif
381375

382376
/* Check custom plugin's log level.
383377
* Not for core plugins but for Golang plugins.

src/proxy/go/go.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ int proxy_go_custom_register(struct flb_plugin_proxy *proxy,
295295

296296
plugin = flb_malloc(sizeof(struct flbgo_custom_plugin));
297297
if (!plugin) {
298+
flb_errno();
298299
return -1;
299300
}
300301

@@ -333,8 +334,8 @@ int proxy_go_custom_init(struct flb_plugin_proxy *proxy)
333334
/* set the API */
334335
plugin->api = proxy->api;
335336
plugin->i_ins = proxy->instance;
336-
// In order to avoid having the whole instance as part of the ABI we
337-
// copy the context pointer into the plugin.
337+
/* In order to avoid having the whole instance as part of the ABI we */
338+
/* copy the context pointer into the plugin. */
338339
plugin->context = ((struct flb_custom_instance *)proxy->instance)->context;
339340

340341
ret = plugin->cb_init(plugin);
@@ -354,7 +355,6 @@ int proxy_go_custom_destroy(struct flb_plugin_proxy_context *ctx)
354355
struct flbgo_custom_plugin *plugin;
355356

356357
plugin = (struct flbgo_custom_plugin *) ctx->proxy->data;
357-
flb_debug("[GO] running exit callback");
358358

359359
if (plugin->cb_exit) {
360360
ret = plugin->cb_exit();

0 commit comments

Comments
 (0)