Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix data lost on decompression #2547

Merged
merged 2 commits into from
Aug 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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