Skip to content

Commit

Permalink
config: add slist context for stream processor init
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Apr 6, 2019
1 parent 5a74192 commit 1fd3c59
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/fluent-bit/flb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,14 @@ struct flb_config {
#endif

#ifdef FLB_HAVE_STREAM_PROCESSOR
char *stream_processor_file; /* SP configuration file */
void *stream_processor_ctx; /* SP context */
char *stream_processor_file; /* SP configuration file */
void *stream_processor_ctx; /* SP context */

/*
* Temporal list to hold tasks defined before the SP context is created
* by the engine. The list is passed upon start and destroyed.
*/
struct mk_list stream_processor_tasks;
#endif

/* Co-routines */
Expand Down
7 changes: 7 additions & 0 deletions src/flb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <fluent-bit/flb_config.h>
#include <fluent-bit/flb_parser.h>
#include <fluent-bit/flb_plugins.h>
#include <fluent-bit/flb_slist.h>
#include <fluent-bit/flb_io_tls.h>
#include <fluent-bit/flb_kernel.h>
#include <fluent-bit/flb_worker.h>
Expand Down Expand Up @@ -156,6 +157,10 @@ struct flb_config *flb_config_init()
mk_list_init(&config->luajit_list);
#endif

#ifdef FLB_HAVE_STREAM_PROCESSOR
flb_slist_create(&config->stream_processor_tasks);
#endif

/* Set default coroutines stack size */
config->coro_stack_size = FLB_THREAD_STACK_SIZE;

Expand Down Expand Up @@ -309,6 +314,8 @@ void flb_config_exit(struct flb_config *config)
if (config->stream_processor_file) {
flb_free(config->stream_processor_file);
}

flb_slist_destroy(&config->stream_processor_tasks);
#endif

if (config->evl) {
Expand Down

0 comments on commit 1fd3c59

Please sign in to comment.