Closed
Conversation
* Box Error::Http Reduce Error size 136 -> 56 * Box Error::WriteBufferFull Reduce Error size 56 -> 40 * Box ProtocolError::InvalidHeader, TlsError::Native, TlsError::Rustls Reduce ProtocolError size 40 -> 16 Reduce TlsError size 64 -> 16 Reduce Error size 40/64 -> 32 * Update changelog * Make the code worse so users can use old rustc from 2022
Add types for the Sec-WebSocket-Extensions header, as described by RFC 6455 Section 11.3.2, and the constituent parts. Add parsing and serialization routines. Based on work by Benjamin Swart <[email protected]>.
Add parsing and client/server parameter negotiation for the permessage-deflate extension from the Sec-WebSocket-Extensions header according to RFC 7692. Based on work by Benjamin Swart <[email protected]>.
Add a DeflateContext that can be used to compress and decompress the payloads of a single connection. Delegate to the flate2 library for the actual algorithm. Based on work by Benjamin Swart <[email protected]>
This will let us include it in the ProtocolError hierarchy.
Add types representing the configuration for, and then actual in-use subset of, websocket protocol extensions for a connection. Currently only permessage-deflate is supported, but having an enum is zero-cost when it has only zero or one variants, and an empty struct takes up no space. This also lets us reduce the amount of code that needs to be annotated with `#[cfg(feature = "deflate")]` since calling code can always assume that the PerMessageCompressionContext type exists even if its method impls are sometimes no-ops. Based on work by Benjamin Swart <[email protected]>
Make the necessary changes to the websocket protocol implementation to use the PMCE compressor and decompressor when the connection has one enabled. This doesn't wire up the negotiation during handshaking, just enables usage for an already-established connection. Based on work by Benjamin Swart <[email protected]>
Also enable construction of WebSocket instances with configured extensions. Based on work by Benjamin Swart <[email protected]>
Based on work by Benjamin Swart <[email protected]>
Switch to using flate2's Compress and Decompress types directly instead of via std::io::Write-implementing wrappers. This lets us avoid an intermediate buffer in each direction.
Add an argument to control how much compressed data is returned before an error is returned. Pass down the remaining per-message limit when decompressing a frame.
983a7d5 to
ebdbe86
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add support for the "permessage-deflate" websocket protocol extension as specified by RFC 7692. This is based off of snapview#426 but adds