From 6c0371729811635b7aab5d9381be7b4a367d0d13 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Wed, 12 Jun 2024 17:50:22 +0900 Subject: [PATCH] refactor some variable names Signed-off-by: Daijiro Fukuda --- lib/fluent/plugin/in_tail.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/fluent/plugin/in_tail.rb b/lib/fluent/plugin/in_tail.rb index 6c600847b5..dd94560d0b 100644 --- a/lib/fluent/plugin/in_tail.rb +++ b/lib/fluent/plugin/in_tail.rb @@ -1011,7 +1011,7 @@ def initialize(from_encoding, encoding, log, max_line_size=nil) @buffer = ''.force_encoding(from_encoding) @eol = "\n".encode(from_encoding).freeze @max_line_size = max_line_size - @was_long_line = false + @skip_current_line = false @log = log end @@ -1058,13 +1058,13 @@ def read_lines(lines) idx = @buffer.index(@eol) is_long_line = @max_line_size && ( - rbuf.bytesize > @max_line_size || @was_long_line + @skip_current_line || rbuf.bytesize > @max_line_size ) if is_long_line @log.warn "received line length is longer than #{@max_line_size}" @log.debug("skipped line: ") { convert(rbuf).chomp } - @was_long_line = false + @skip_current_line = false has_skipped_line = true next end @@ -1072,13 +1072,13 @@ def read_lines(lines) lines << convert(rbuf) end - is_long_line = @max_line_size && ( - @buffer.bytesize > @max_line_size || @was_long_line + is_long_current_line = @max_line_size && ( + @skip_current_line || @buffer.bytesize > @max_line_size ) - if is_long_line + if is_long_current_line @buffer.clear - @was_long_line = true + @skip_current_line = true end return has_skipped_line