Skip to content

Commit

Permalink
lib: add new api to free buffer which comes from out_lib_flush
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro YAMASHITA <[email protected]>
  • Loading branch information
nokute78 committed May 24, 2017
1 parent 1bf77c0 commit 90061a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/fluent-bit/flb_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ FLB_EXPORT int flb_input_set(flb_ctx_t *ctx, int ffd, ...);
FLB_EXPORT int flb_output_set(flb_ctx_t *ctx, int ffd, ...);
FLB_EXPORT int flb_filter_set(flb_ctx_t *ctx, int ffd, ...);
FLB_EXPORT int flb_service_set(flb_ctx_t *ctx, ...);
FLB_EXPORT int flb_lib_free(void *data);
FLB_EXPORT double flb_time_now();

/* start stop the engine */
Expand Down
11 changes: 11 additions & 0 deletions src/flb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,17 @@ int flb_lib_config_file(struct flb_lib_ctx *ctx, char *path)
return 0;
}

/* This is a wrapper to release a buffer which comes from out_lib_flush() */
int flb_lib_free(void* data)
{
if (data == NULL) {
return -1;
}
flb_free(data);
return 0;
}


/* Push some data into the Engine */
int flb_lib_push(flb_ctx_t *ctx, int ffd, void *data, size_t len)
{
Expand Down

0 comments on commit 90061a0

Please sign in to comment.