-
Notifications
You must be signed in to change notification settings - Fork 9
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.
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
fixed inflating uncompressed messages in deflate extension #12
Conversation
@@ -33,7 +33,7 @@ use tokio::io::AsyncRead; | |||
use tokio_util::codec::Decoder; | |||
use url::Url; | |||
|
|||
pub use client::{subscribe, subscribe_with, HandshakeResult, UpgradedClient}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was made to satisfy linter, according to rules here - https://github.com/swimos/ratchet/blob/main/ratchet_core/src/lib.rs#L25
@GenrikhFetischev, apologies for the very late response and thank you for raising an issue and submitting a fix. While it appears that the logic in the block where you applied your fix is incorrect, your fix does not include support for fragmented messages. For a fragmented message, only the first frame will have
For this to work, the decode implementation needs to check if the match header.opcode {
OpCode::Binary | OpCode::Text if header.rsv1 => {
if !header.fin {
*compressed = true;
return Ok(());
}
}
OpCode::Continuation if header.fin && *compressed => {}
_ => return Ok(()),
} |
@SirCipher Yep, good catch! |
@GenrikhFetischev, you're welcome to submit a PR for it! 😄 |
@SirCipher ok, will work on it soon 🤝 |
8424d58
to
965b7e5
Compare
@SirCipher I have updated PR, could you take a look please? |
@GenrikhFetischev merged. Thanks for your contributions! |
@SirCipher it was a pleasure considering you have provided solution 🙂 |
This PR created as a quick fix of the decompression issue