diff options
author | Johan Planchon <[email protected]> | 2024-04-10 22:06:14 +0000 |
---|---|---|
committer | Kevin Guthrie <[email protected]> | 2024-04-26 12:31:57 -0400 |
commit | 218dbdfd5d7f7eba2a1923507ed10e7da95ecc9a (patch) | |
tree | cd2aa54bd78d9d03227e0670e272dd3f6c07cba1 | |
parent | e19d8c817d78469d3d13f9889e33f9f146297cc5 (diff) | |
download | pingora-218dbdfd5d7f7eba2a1923507ed10e7da95ecc9a.tar.gz pingora-218dbdfd5d7f7eba2a1923507ed10e7da95ecc9a.zip |
Update zstd-safe to 7.1.0 and zstd to 0.13.1 in pingora-header-serde
Includes-commit: 0026a572a7849c7a43f89629b36ce9d4cb287cb5
Replicated-from: https://github.com/cloudflare/pingora/pull/197
-rw-r--r-- | .bleep | 2 | ||||
-rw-r--r-- | pingora-header-serde/Cargo.toml | 4 | ||||
-rw-r--r-- | pingora-header-serde/src/thread_zstd.rs | 5 |
3 files changed, 6 insertions, 5 deletions
@@ -1 +1 @@ -996a452a8ef2543944390046e383351d79c8e803
\ No newline at end of file +ffd2f7edb1d520d04fe3ec61dab949b10ff6e0f1
\ No newline at end of file diff --git a/pingora-header-serde/Cargo.toml b/pingora-header-serde/Cargo.toml index 2968cae..eaaa643 100644 --- a/pingora-header-serde/Cargo.toml +++ b/pingora-header-serde/Cargo.toml @@ -22,8 +22,8 @@ name = "trainer" path = "src/trainer.rs" [dependencies] -zstd = "0.9.0" -zstd-safe = "4.1.1" +zstd = "0.13.1" +zstd-safe = { version = "7.1.0", features = ["std"] } http = { workspace = true } bytes = { workspace = true } httparse = { workspace = true } diff --git a/pingora-header-serde/src/thread_zstd.rs b/pingora-header-serde/src/thread_zstd.rs index 5c6406e..cda5d06 100644 --- a/pingora-header-serde/src/thread_zstd.rs +++ b/pingora-header-serde/src/thread_zstd.rs @@ -14,6 +14,7 @@ use std::cell::RefCell; use thread_local::ThreadLocal; +use zstd_safe::{CCtx, DCtx}; /// Each thread will own its compression and decompression CTXes, and they share a single dict /// https://facebook.github.io/zstd/zstd_manual.html recommends to reuse ctx per thread @@ -50,7 +51,7 @@ impl Compression { level: i32, ) -> Result<usize, &'static str> { self.com_context - .get_or(|| RefCell::new(zstd_safe::create_cctx())) + .get_or(|| RefCell::new(CCtx::create())) .borrow_mut() .compress_using_dict(destination, source, &self.dict[..], level) .map_err(zstd_safe::get_error_name) @@ -71,7 +72,7 @@ impl Compression { destination: &mut C, ) -> Result<usize, &'static str> { self.de_context - .get_or(|| RefCell::new(zstd_safe::create_dctx())) + .get_or(|| RefCell::new(DCtx::create())) .borrow_mut() .decompress_using_dict(destination, source, &self.dict) .map_err(zstd_safe::get_error_name) |