diff --git a/crates/tarball/src/lib.rs b/crates/tarball/src/lib.rs index c182ff4a..fc4571c0 100644 --- a/crates/tarball/src/lib.rs +++ b/crates/tarball/src/lib.rs @@ -17,7 +17,7 @@ use pacquet_store_dir::{ }; use pipe_trait::Pipe; use reqwest::Client; -use ssri::{Integrity, IntegrityChecker}; +use ssri::Integrity; use tar::Archive; use tokio::sync::{Notify, RwLock}; use tracing::instrument; @@ -103,11 +103,6 @@ fn decompress_gzip(gz_data: &[u8], unpacked_size: Option) -> Result Result { - integrity.pipe(IntegrityChecker::new).chain(data).result() -} - /// This subroutine downloads and extracts a tarball to the store directory. /// /// It returns a CAS map of files in the tarball. @@ -200,8 +195,8 @@ impl<'a> DownloadTarballToStore<'a> { Checksum(ssri::Error), Other(TarballError), } - let cas_paths = tokio::task::spawn(async move { - verify_checksum(&response, package_integrity.clone()).map_err(TaskError::Checksum)?; + let cas_paths = tokio::task::spawn_blocking(move || { + package_integrity.check(&response).map_err(TaskError::Checksum)?; // TODO: move tarball extraction to its own function // TODO: test it