Skip to content

Commit

Permalink
config_format: cf_fluentbit: Handle static config correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Nov 13, 2024
1 parent 50512ed commit c0f1bf1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/config_format/flb_cf_fluentbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static int read_config(struct flb_cf *cf, struct local_ctx *ctx,
* workaround to retrieve the lines.
*/
size_t off = 0;
while (static_fgets(buf, FLB_CF_BUF_SIZE, in_data, &off)) {
while (static_fgets(buf, FLB_DEFAULT_CF_BUF_SIZE, in_data, &off)) {
#else
/* normal mode, read lines into a buffer */
/* note that we use "fgets_ptr" so we can continue reading after realloc */
Expand All @@ -518,10 +518,15 @@ static int read_config(struct flb_cf *cf, struct local_ctx *ctx,
/* after a successful line read, restore "fgets_ptr" to point to the
* beginning of buffer */
fgets_ptr = buf;
} else if (feof(f)) {
}
#ifndef FLB_HAVE_STATIC_CONF
/* When using static conf build, FILE pointer is absent and
* always as NULL. */
else if (feof(f)) {
/* handle EOF without a newline(CRLF or LF) */
fgets_ptr = buf;
}
#endif
#ifndef FLB_HAVE_STATIC_CONF
else {
/* resize the line buffer */
Expand Down

0 comments on commit c0f1bf1

Please sign in to comment.