From a1faa4fb513c2186ab99e4144086d5c9069490a6 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 20 Dec 2023 11:07:45 +0900 Subject: [PATCH] engine: Handle zero size as no limit Signed-off-by: Hiroshi Hatake --- src/flb_engine.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/flb_engine.c b/src/flb_engine.c index 9163212d7fe..0dc0616b13d 100644 --- a/src/flb_engine.c +++ b/src/flb_engine.c @@ -209,7 +209,9 @@ static inline int handle_input_event(flb_pipefd_t fd, uint64_t ts, static inline double calculate_chunk_capacity_percent(struct flb_output_instance *ins) { - if (ins->total_limit_size == -1) { + /* Currently, total_limit_size 0(K|M)B will be translated as no + * limit. So, we need to handle this situation to be unlimited. */ + if (ins->total_limit_size <= 0) { return 100.0; }