Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 14, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

robert-s-ubi and others added 8 commits December 25, 2025 12:40
Add a reimplementation of the WebSocket Per-Message Deflate extension
written from scratch for full RFC 7962 compliance, with the following
over the existing implementation:

- compliant extension parameters negotiation handling
- default operation with context takeover works
- fragmented messages are handled correctly (either all fragments are
  compressed/decompressed or none)
- clears RSV1 after decompressing to remove the compression mark
- produces the result specified in RFC 7962 section 7.2.3.4
- produces the result specified in RFC 7962 section 7.2.3.6
- uses the extension common name registered for RFC 7962
- has an additional optional constructor parameter "maxFrameSize" to
  ensure the limit is not exceeded while decompressing already
- has an additional API "getCompressionRatio()" to get the effective
  compression ratio (over all payloads compressed and decompressed)

Otherwise, it is fully API compatible with the old implementation.

For now, the new implementation lives side by side with the old one, and
is named "WebSocketPerMessageDeflateExtension".

Add RFC 7962 tests for the new implementation, to validate it produces
the expected results for all examples from RFC 7962 section 7.2.3.

Add a copy of the unit tests for the old implementation, which verifies
the new implementation works the same, except for fixed issues and
different defaults.
Instead of adding WebSocketPerMessageDeflateExtension side by side with
the old PerMessageDeflateExtension, rename the new implementation to the
old name to replace it.
RFC 7692 was often mistyped as RFC 7962. Fix this.
The PerMessageDeflationExtension's optional maxFrameSize constructor
parameter is applied to the size of a fragment while decompressing, and
not to the complete frame size (that size is checked after passing the
decompressed fragment), so rename the parameter to what it actually is.

Add Javadoc to the full-parameter constructor method.
This new API was intended to be called by library users, but could never
have worked, as it would need to be called on the class instance which
is actually processing frames, but that instance is created internally
in the library using copyInstance() and thus inaccessible to the library
users.

Remove the API and the stats kept for it.
The PerMessageDeflateExtension#getCompressionRatio() API needs to be
called on the class instance used by the library. Add Javadoc explaining
how that instance can be retrieved.
…eflate_extension

Add new RFC 7692-compliant Per-Message Deflate extension implementation
@pull pull bot locked and limited conversation to collaborators Jan 14, 2026
@pull pull bot added the ⤵️ pull label Jan 14, 2026
@pull pull bot merged commit afeacbf into xfworld:master Jan 14, 2026
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants