Commit 827bcf8
committed
Add new RFC 7962-compliant Per-Message Deflate extension implementation
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.1 parent 8c5766a commit 827bcf8
File tree
3 files changed
+1168
-0
lines changed- src
- main/java/org/java_websocket/extensions/permessage_deflate
- test/java/org/java_websocket/extensions
3 files changed
+1168
-0
lines changed
0 commit comments