diff --git a/Earthfile b/Earthfile index c4571228..5402fe75 100644 --- a/Earthfile +++ b/Earthfile @@ -93,6 +93,11 @@ build-linux-amd64: RUN cargo build --target x86_64-unknown-linux-gnu --release -p veilid-server -p veilid-cli -p veilid-tools -p veilid-core SAVE ARTIFACT ./target/x86_64-unknown-linux-gnu AS LOCAL ./target/artifacts/x86_64-unknown-linux-gnu +build-linux-amd64-debug: + FROM +code-linux + RUN cargo build --target x86_64-unknown-linux-gnu -p veilid-server -p veilid-cli -p veilid-tools -p veilid-core + SAVE ARTIFACT ./target/x86_64-unknown-linux-gnu AS LOCAL ./target/artifacts/x86_64-unknown-linux-gnu + build-linux-arm64: FROM +code-linux RUN cargo zigbuild --target aarch64-unknown-linux-gnu --release -p veilid-server -p veilid-cli -p veilid-tools -p veilid-core diff --git a/veilid-core/src/crypto/envelope.rs b/veilid-core/src/crypto/envelope.rs index 86ecc657..d361eb25 100644 --- a/veilid-core/src/crypto/envelope.rs +++ b/veilid-core/src/crypto/envelope.rs @@ -214,8 +214,7 @@ impl Envelope { ); // Decompress body - let body = decompress_size_prepended(&body) - .map_err(|e| VeilidAPIError::parse_error("failed to decompress", e))?; + let body = decompress_size_prepended(&body, Some(MAX_ENVELOPE_SIZE))?; Ok(body) } diff --git a/veilid-core/src/lib.rs b/veilid-core/src/lib.rs index 0c973e7d..2446cfe4 100644 --- a/veilid-core/src/lib.rs +++ b/veilid-core/src/lib.rs @@ -89,7 +89,6 @@ use cfg_if::*; use enumset::*; use eyre::{bail, eyre, Report as EyreReport, Result as EyreResult, WrapErr}; use futures_util::stream::FuturesUnordered; -use lz4_flex::block::{compress_prepend_size, decompress_size_prepended}; use parking_lot::*; use schemars::{schema_for, JsonSchema}; use serde::*; diff --git a/veilid-core/src/table_store/table_db.rs b/veilid-core/src/table_store/table_db.rs index a95d3298..da230579 100644 --- a/veilid-core/src/table_store/table_db.rs +++ b/veilid-core/src/table_store/table_db.rs @@ -147,10 +147,10 @@ impl TableDB { (&data[0..NONCE_LENGTH]).try_into().unwrap(), &di.key, ); - decompress_size_prepended(&out) + decompress_size_prepended(&out, None) .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string())) } else { - decompress_size_prepended(data) + decompress_size_prepended(data, None) .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string())) } } diff --git a/veilid-core/src/veilid_api/serialize_helpers/mod.rs b/veilid-core/src/veilid_api/serialize_helpers/mod.rs index e18fb135..5a22cdfe 100644 --- a/veilid-core/src/veilid_api/serialize_helpers/mod.rs +++ b/veilid-core/src/veilid_api/serialize_helpers/mod.rs @@ -5,3 +5,5 @@ pub mod serialize_arc; mod serialize_json; pub mod serialize_range_set_blaze; pub use serialize_json::*; +mod compression; +pub use compression::*;