aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-01 14:11:11 -0500
committermat <github@matdoes.dev>2022-05-01 14:11:11 -0500
commit0ccf203460007f4472e9018f8cefbd95d1ee1ce6 (patch)
tree6063bd3d3d17fca0429fabc84526c5d3c724eb6a
parent766b29006511e22eee8d6aae199c40203e5dcb0c (diff)
downloadazalea-drasl-0ccf203460007f4472e9018f8cefbd95d1ee1ce6.tar.xz
Fix writing encrypted packets
-rwxr-xr-xazalea-protocol/src/write.rs2
1 files changed, 1 insertions, 1 deletions
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<P, W>(
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();
}