5 Commits

Author SHA1 Message Date
Erik Dubbelboer 4001e91911 Fix acquireRealZstdWriter panic
Pass the normalized compression level to prevent zstd.WithEncoderLevel
from returning an error.

Fixes https://github.com/valyala/fasthttp/issues/2157
2026-03-16 02:35:36 +01:00
Erik Dubbelboer f0d5d9a5cb Add WithLimit methods for uncompression (#2147)
* Add WithLimit methods for uncompression

The current uncompress methods don't enforce a memory limit and are
susceptible to things like zip bombs. This pull introduces new methods
so retain backwards compatibility. The old methods might be deprecated
in the future.

* Fix suggestion
2026-02-22 18:13:40 +01:00
Erik Dubbelboer ab3c358753 zstdEncoderPool was never used
releaseZstdWriter() is never called, so zstdEncoderPool is only used for Get(), never Put().

We can just inline the non Get() path of acquireZstdWriter() and remove releaseZstdWriter().

Also fixed some spelling mistakes.
2025-07-21 05:33:35 +02:00
Juan Calderon-Perez 1fb3453165 Use Named Fields and Align Structures to Reduce Memory Usage (#1814)
* Use Named fields and Align Structures to Reduce Memory Usage

* Remove extra spaces
2024-08-02 22:26:52 +02:00
Co1a 5f81476d7c feat:support zstd compress and uncompressed (#1701)
* feat:support zstd compress and uncompressed

* fix:real & stackless write using different pool to avoid get stackless.writer

* fix:zstd normalize compress level

* Change empty string checks to be more idiomatic (#1684)

* chore:lint fix and rebase with master

* chore:remove 1.18 test & upgrade compress version

* fix:error default compress level

* Fix lint

---------

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2024-02-21 07:21:52 +01:00