Fix fallback compression handler

This commit is contained in:
Shane Freeder
2025-01-17 15:10:06 +00:00
parent c0fdf20224
commit 71feb11b2e

View File

@@ -57,7 +57,8 @@ public class JavaVelocityCompressor implements VelocityCompressor {
inflater.setInput(source.nioBuffer()); inflater.setInput(source.nioBuffer());
try { try {
while (!inflater.finished() && inflater.getBytesWritten() < uncompressedSize) { final int readable = source.readableBytes();
while (!inflater.finished() && inflater.getBytesRead() < readable) {
if (!destination.isWritable()) { if (!destination.isWritable()) {
destination.ensureWritable(ZLIB_BUFFER_SIZE); destination.ensureWritable(ZLIB_BUFFER_SIZE);
} }