lib/fluent/plugin/in_tail.rb in fluentd-0.12.29 vs lib/fluent/plugin/in_tail.rb in fluentd-0.12.30
- old
+ new
@@ -577,11 +577,11 @@
if @buffer.empty?
@io.readpartial(2048, @buffer)
else
@buffer << @io.readpartial(2048, @iobuf)
end
- while line = @buffer.slice!(/.*?\n/m)
- @lines << line
+ while idx = @buffer.index("\n".freeze)
+ @lines << @buffer.slice!(0, idx + 1)
end
if @lines.size >= @read_lines_limit
# not to use too much memory in case the file is very large
read_more = true
break