fix: sorta-of fix decomp error

This commit is contained in:
kozabrada123 2024-06-23 17:01:48 +02:00
parent a0887e4bef
commit f7f37fd7d7
1 changed files with 3 additions and 1 deletions

View File

@ -90,7 +90,9 @@ impl GatewayMessage {
bytes: &[u8],
inflate: &mut flate2::Decompress,
) -> Result<GatewayMessage, std::io::Error> {
let mut output = Vec::with_capacity(bytes.len() * 10);
// Note: is there a better way to handle the size of this output buffer?
let mut output = Vec::with_capacity(bytes.len() * 32);
let _status = inflate.decompress_vec(bytes, &mut output, flate2::FlushDecompress::Sync)?;
output.shrink_to_fit();