mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
fix error that happens in linux + release mode
This commit is contained in:
parent
153b5b45e4
commit
7f9463320f
1 changed files with 6 additions and 2 deletions
|
@ -118,8 +118,12 @@ where
|
|||
let polled = self.as_mut().stream.as_mut().poll_read(cx, buf);
|
||||
match polled {
|
||||
Poll::Ready(r) => {
|
||||
if let Some(cipher) = self.as_mut().cipher.get_mut() {
|
||||
azalea_auth::encryption::decrypt_packet(cipher, buf.initialized_mut());
|
||||
// if we don't check for the remaining then we decrypt big packets incorrectly
|
||||
// (but only on linux and release mode for some reason LMAO)
|
||||
if buf.remaining() == 0 {
|
||||
if let Some(cipher) = self.as_mut().cipher.get_mut() {
|
||||
azalea_auth::encryption::decrypt_packet(cipher, buf.filled_mut());
|
||||
}
|
||||
}
|
||||
match r {
|
||||
Ok(()) => Poll::Ready(Ok(())),
|
||||
|
|
Loading…
Add table
Reference in a new issue