1
2
Fork 0
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:
mat 2022-04-30 16:56:59 -05:00
parent 153b5b45e4
commit 7f9463320f

View file

@ -118,8 +118,12 @@ where
let polled = self.as_mut().stream.as_mut().poll_read(cx, buf); let polled = self.as_mut().stream.as_mut().poll_read(cx, buf);
match polled { match polled {
Poll::Ready(r) => { Poll::Ready(r) => {
if let Some(cipher) = self.as_mut().cipher.get_mut() { // if we don't check for the remaining then we decrypt big packets incorrectly
azalea_auth::encryption::decrypt_packet(cipher, buf.initialized_mut()); // (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 { match r {
Ok(()) => Poll::Ready(Ok(())), Ok(()) => Poll::Ready(Ok(())),