Skip to content

Commit

Permalink
Fix brotli compression of files > 128 KiB
Browse files Browse the repository at this point in the history
This has been broken since faa31f4.
  • Loading branch information
edolstra committed Apr 20, 2021
1 parent b60b0d6 commit 8d651a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libutil/compression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct ChunkedCompressionSink : CompressionSink
const size_t CHUNK_SIZE = sizeof(outbuf) << 2;
while (!data.empty()) {
size_t n = std::min(CHUNK_SIZE, data.size());
writeInternal(data);
writeInternal(data.substr(0, n));
data.remove_prefix(n);
}
}
Expand Down Expand Up @@ -265,7 +265,8 @@ struct BrotliCompressionSink : ChunkedCompressionSink
}
};

std::unique_ptr<Source> makeDecompressionSource(Source & prev) {
std::unique_ptr<Source> makeDecompressionSource(Source & prev)
{
return std::unique_ptr<Source>(new ArchiveDecompressionSource(prev));
}

Expand Down

0 comments on commit 8d651a1

Please sign in to comment.