From 0ccf203460007f4472e9018f8cefbd95d1ee1ce6 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 1 May 2022 14:11:11 -0500 Subject: Fix writing encrypted packets --- azalea-protocol/src/write.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'azalea-protocol/src') diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs index 38ef174c..345829c5 100755 --- a/azalea-protocol/src/write.rs +++ b/azalea-protocol/src/write.rs @@ -65,10 +65,10 @@ pub async fn write_packet( if let Some(threshold) = compression_threshold { buf = compression_encoder(&buf, threshold).await.unwrap(); } + buf = frame_prepender(&mut buf).unwrap(); // if we were given a cipher, encrypt the packet if let Some(cipher) = cipher { azalea_crypto::encrypt_packet(cipher, &mut buf); } - buf = frame_prepender(&mut buf).unwrap(); stream.write_all(&buf).await.unwrap(); } -- cgit v1.2.3