fix client decompression

This commit is contained in:
griffi-gh 2023-03-09 17:56:30 +01:00
parent 68bc848cbd
commit 739e53c0a9

View file

@ -112,8 +112,8 @@ fn check_server_hello_response(
//TODO multithreaded decompression
fn decompress_chunk_packet(data: &Box<[u8]>) -> Result<ServerToClientMessage> {
let data_ref = &data[1..];
let decompressed = decompress_size_prepended(data_ref)?;
let mut decompressed = decompress_size_prepended(&data[1..])?;
decompressed.insert(0, data[0]);
let deserialized = postcard::from_bytes(&decompressed).ok().context("Deserialization failed")?;
Ok(deserialized)
}