Skip to main content

zstd_decompress_limited

Function zstd_decompress_limited 

Source
pub(crate) async fn zstd_decompress_limited(
    buf: &[u8],
    max_decompressed: usize,
    limiter: &ServerMemoryLimiter,
) -> Result<ChargedBuffer>
Expand description

Decompresses a zstd body with a hard cap on the decoded size, charging the aggregate request-memory limiter incrementally while the output is materialized (zstd streams don’t declare their decoded size up front).