Skip to content

Conversation

@lucascompython
Copy link

@lucascompython lucascompython commented Dec 24, 2025

I didn't run cargo fmt --all because it formatted tens of files, maybe that should be done in another PR.
From my own testing, both zlib and zstd work now.
I also enabled the std feature of the zstd-safe crate so that we don't have to manually manage the buffer, hope that's ok.

Before these changes the decompressed buffer had 64KB of fixed size, so larger messages would be truncated and that caused the parsing errors.
The code before for zlib also assumed decompression happened in one call, but flate2::Decompress::decompress_vec doesn't manage the vec so it only writes as much as it can currently fit in it.

@github-actions github-actions bot added the gateway Related to the `gateway` module. label Dec 24, 2025
@KiloOscarSix
Copy link
Contributor

fmt uses the nightly version, you'll need to install the nightly toolchain and then run cargo +nightly fmt

@lucascompython
Copy link
Author

fmt uses the nightly version, you'll need to install the nightly toolchain and then run cargo +nightly fmt

Didn't know about that, oops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Related to the `gateway` module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants