mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
comment some stuff out
This commit is contained in:
parent
4d7bf6c50e
commit
c37fcfe4da
1 changed files with 10 additions and 3 deletions
|
@ -138,22 +138,29 @@ pub async fn read_packet<'a, P: ProtocolPacket, R>(
|
||||||
where
|
where
|
||||||
R: AsyncRead + std::marker::Unpin + std::marker::Send + std::marker::Sync,
|
R: AsyncRead + std::marker::Unpin + std::marker::Send + std::marker::Sync,
|
||||||
{
|
{
|
||||||
|
// let start_time = std::time::Instant::now();
|
||||||
|
|
||||||
|
// println!("decrypting packet ({}ms)", start_time.elapsed().as_millis());
|
||||||
// if we were given a cipher, decrypt the packet
|
// if we were given a cipher, decrypt the packet
|
||||||
let mut encrypted_stream = EncryptedStream {
|
let mut encrypted_stream = EncryptedStream {
|
||||||
cipher: Cell::new(cipher),
|
cipher: Cell::new(cipher),
|
||||||
stream: &mut Pin::new(stream),
|
stream: &mut Pin::new(stream),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// println!("splitting packet ({}ms)", start_time.elapsed().as_millis());
|
||||||
let mut buf = frame_splitter(&mut encrypted_stream).await?;
|
let mut buf = frame_splitter(&mut encrypted_stream).await?;
|
||||||
|
|
||||||
if let Some(compression_threshold) = compression_threshold {
|
if let Some(compression_threshold) = compression_threshold {
|
||||||
|
// println!(
|
||||||
|
// "decompressing packet ({}ms)",
|
||||||
|
// start_time.elapsed().as_millis()
|
||||||
|
// );
|
||||||
buf = compression_decoder(&mut buf.as_slice(), compression_threshold).await?;
|
buf = compression_decoder(&mut buf.as_slice(), compression_threshold).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
let start_time = std::time::Instant::now();
|
// println!("decoding packet ({}ms)", start_time.elapsed().as_millis());
|
||||||
println!("decoding packet");
|
|
||||||
let packet = packet_decoder(&mut buf.as_slice(), flow).await?;
|
let packet = packet_decoder(&mut buf.as_slice(), flow).await?;
|
||||||
println!("decoded packet in {}ms", start_time.elapsed().as_millis());
|
// println!("decoded packet ({}ms)", start_time.elapsed().as_millis());
|
||||||
|
|
||||||
Ok(packet)
|
Ok(packet)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue