From 940a43330a85e2de2f9bac1df5448ee1c7d35639 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Thu, 9 Mar 2023 17:56:30 +0100 Subject: [PATCH] fix client decompression --- kubi/src/networking.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kubi/src/networking.rs b/kubi/src/networking.rs index 61d3eac..38ae7a0 100644 --- a/kubi/src/networking.rs +++ b/kubi/src/networking.rs @@ -112,8 +112,8 @@ fn check_server_hello_response( //TODO multithreaded decompression fn decompress_chunk_packet(data: &Box<[u8]>) -> Result { - 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) }