Skip to content

Commit

Permalink
Merge pull request #2547 from komeda-shinji/fix-compressable-data-lost
Browse files Browse the repository at this point in the history
fix data lost on decompression
  • Loading branch information
repeatedly authored Aug 10, 2019
2 parents 33beb99 + 2976dde commit 9e88103
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/fluent/plugin/compressable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ def string_decompress(compressed_data)
unused = gz.unused
gz.finish

break if unused.nil?
adjust = unused.length
io.pos -= adjust
unless unused.nil?
adjust = unused.length
io.pos -= adjust
end
break if io.eof?
end

out
Expand All @@ -80,9 +82,11 @@ def io_decompress(input, output)
unused = gz.unused
gz.finish

break if unused.nil?
adjust = unused.length
input.pos -= adjust
unless unused.nil?
adjust = unused.length
input.pos -= adjust
end
break if input.eof?
end

output
Expand Down

0 comments on commit 9e88103

Please sign in to comment.