mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-25 05:08:21 -06:00
fix client decompression
This commit is contained in:
parent
9cf4e81818
commit
940a43330a
|
@ -112,8 +112,8 @@ fn check_server_hello_response(
|
||||||
|
|
||||||
//TODO multithreaded decompression
|
//TODO multithreaded decompression
|
||||||
fn decompress_chunk_packet(data: &Box<[u8]>) -> Result<ServerToClientMessage> {
|
fn decompress_chunk_packet(data: &Box<[u8]>) -> Result<ServerToClientMessage> {
|
||||||
let data_ref = &data[1..];
|
let mut decompressed = decompress_size_prepended(&data[1..])?;
|
||||||
let decompressed = decompress_size_prepended(data_ref)?;
|
decompressed.insert(0, data[0]);
|
||||||
let deserialized = postcard::from_bytes(&decompressed).ok().context("Deserialization failed")?;
|
let deserialized = postcard::from_bytes(&decompressed).ok().context("Deserialization failed")?;
|
||||||
Ok(deserialized)
|
Ok(deserialized)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue