Skip to content

Commit

Permalink
fix EOFException on gzip decompress w/empty buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
erawhctim committed Oct 31, 2023
1 parent ce9d23e commit 38c547e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ object GzipCompressionPool : CompressionPool {

override fun decompress(buffer: Buffer): Buffer {
val result = Buffer()
if (buffer.size == 0L) return result

GzipSource(buffer).use {
while (it.read(result, Int.MAX_VALUE.toLong()) != -1L) {
// continue reading.
Expand Down

0 comments on commit 38c547e

Please sign in to comment.