Skip to content

Commit

Permalink
do not generate random key in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyrchien committed Apr 14, 2022
1 parent 43f43c0 commit 657d828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/role/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl RoleHelper for StandardClient {
client_consts!();

#[inline]
fn new() -> Self { Self(crate::frame::mask::new_mask_key()) }
fn new() -> Self { Self([9u8; 4]) }

#[inline]
fn write_mask_key(&self) -> Mask { Mask::Key(self.0) }
Expand All @@ -64,7 +64,7 @@ impl RoleHelper for FixedMaskClient {
client_consts!();

#[inline]
fn new() -> Self { Self(crate::frame::mask::new_mask_key()) }
fn new() -> Self { Self([9u8; 4]) }

#[inline]
fn write_mask_key(&self) -> Mask { Mask::Key(self.0) }
Expand Down
2 changes: 1 addition & 1 deletion src/stream/detail/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ mod test {
for _ in 0..8 {
auto_mask(&mut role, &buf2);
assert_eq!(key, role.write_mask_key().to_key());

apply_mask4(key, &mut buf);
assert_eq!(buf, buf2);
}
Expand Down

0 comments on commit 657d828

Please sign in to comment.