diff --git a/.bleep b/.bleep index 2c3806d..d82b8a3 100644 --- a/.bleep +++ b/.bleep @@ -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 { 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 { 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)