GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Codec-compression: Add zlib decompressors by yawkat · Pull Request #17155 · netty/netty

Codec-compression: Add zlib decompressors #17155

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.

Sign up for GitHub

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

Merged
chrisvest merged 25 commits into 4.2 from extract-zlib-decompressors
Jul 28, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Codec-compression: Add zlib decompressors #17155

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5737cd5
Codec-compression: Add zlib decompressor base
yawkat Jul 27, 2026
731fa0b
Codec-compression: Add JZlib decompressor
yawkat Jul 27, 2026
5b23fd4
Codec-compression: Add JDK zlib decompressor
yawkat Jul 27, 2026
fb6b4d6
ZlibCodecFactory: Add decompressor builder
yawkat Jul 27, 2026
1c8a165
JZlibDecompressor: Restore parent PR implementation
yawkat Jul 27, 2026
faa1113
JdkZlibDecompressor: Restore parent PR implementation
yawkat Jul 27, 2026
238f04d
ZlibDecompressor: Restore parent PR implementation
yawkat Jul 27, 2026
29321f0
JdkZlibDecompressor: Fix GZIP FEXTRA handling
yawkat Jul 27, 2026
0685084
JdkZlibDecompressor: Report complete after GZIP footer
yawkat Jul 27, 2026
754c82e
JZlibDecompressor: Release output on failure
yawkat Jul 27, 2026
d0af116
JdkZlibDecompressor: Release inflater on close
yawkat Jul 27, 2026
517d309
ZlibDecompressor: Reject negative max allocation
yawkat Jul 27, 2026
58fcb85
JZlibDecompressor: Reject truncated input
yawkat Jul 27, 2026
1ac2e09
JdkZlibDecompressor: Reject truncated input
yawkat Jul 27, 2026
3fe084a
JdkZlibDecompressor: Release output on failure
yawkat Jul 27, 2026
31a58ca
JZlibDecompressor: Release inflater on close
yawkat Jul 27, 2026
6a980a6
JdkZlibDecompressor: Validate GZIP magic
yawkat Jul 27, 2026
b6029da
JZlibDecompressorTest: Use try-with-resources
yawkat Jul 27, 2026
80a44f1
JZlibDecompressor: Simplify inflater lifecycle
yawkat Jul 27, 2026
732cf87
JZlibDecompressorTest: Cover direct input across outputs
yawkat Jul 27, 2026
cc1cc0c
JdkZlibDecompressor: Fix dictionary error message
yawkat Jul 27, 2026
b50e971
ZlibCodecFactory: Mark decompressor APIs unstable
yawkat Jul 27, 2026
914dfb7
ZlibCodecFactory: Remove decompressor builder
yawkat Jul 28, 2026
86a0db0
Codec-compression: Remove JZlib decompressor
yawkat Jul 28, 2026
553478f
JdkZlibDecompressor: Inline zlib decompressor base
yawkat Jul 28, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
JdkZlibDecompressor: Release inflater on close
Co-Authored-By: multicode <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@yawkat @multicode-agent
yawkat and multicode-agent committed Jul 27, 2026
commit d0af11646f00a0c2a3868a3b2e51d061d1ee3826

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

12 changes: 12 additions & 0 deletions 12 codec-compression/src/main/java/io/netty/handler/codec/compression/JdkZlibDecompressor.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,18 @@ private static boolean looksLikeZlib(short cmf_flg) {
cmf_flg % 31 == 0;
}

@Override
public void close() {
try {
super.close();
} finally {
if (inflater != null) {
inflater.end();
inflater = null;
}
}
}

@UnstableApi
public static Builder builder() {
return new Builder();
Expand Down
12 changes: 12 additions & 0 deletions 12 ...compression/src/test/java/io/netty/handler/codec/compression/JdkZlibDecompressorTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.zip.GZIPOutputStream;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
@ParameterizedClass
Expand Down Expand Up @@ -74,6 +75,17 @@ public void testGzipCompletesAfterFooter() throws Exception {
}
}

@Test
public void testCloseBeforeCompletionIsIdempotent() {
assumeTrue(wrapper == ZlibWrapper.GZIP);
Decompressor decompressor = JdkZlibDecompressor.builder().wrapper(ZlibWrapper.GZIP)
.build(ByteBufAllocator.DEFAULT);
assertEquals(Decompressor.Status.NEED_INPUT, decompressor.status());
decompressor.addInput(Unpooled.wrappedBuffer(new byte[] { 31 }));
assertDoesNotThrow(decompressor::close);
assertDoesNotThrow(decompressor::close);
}

@Test
public void testGZIPDecodeWithExtraField() throws Exception {
assumeTrue(wrapper == ZlibWrapper.GZIP);
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.