Skip to content

Commit fdb82ed

Browse files
committed
Make is_compressed immutable
1 parent 147593f commit fdb82ed

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/protocol/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,17 +505,14 @@ impl WebSocketContext {
505505
// the negotiated extensions defines the meaning of such a nonzero
506506
// value, the receiving endpoint MUST _Fail the WebSocket
507507
// Connection_.
508-
let mut is_compressed = false;
509-
{
508+
let is_compressed = {
510509
let hdr = frame.header();
511510
if (hdr.rsv1 && self.pmce.is_none()) || hdr.rsv2 || hdr.rsv3 {
512511
return Err(Error::Protocol(ProtocolError::NonZeroReservedBits));
513512
}
514513

515-
if hdr.rsv1 && self.pmce.is_some() {
516-
is_compressed = true;
517-
}
518-
}
514+
hdr.rsv1
515+
};
519516

520517
match self.role {
521518
Role::Server => {

0 commit comments

Comments
 (0)