decompression fix for OOM
This commit is contained in:
parent
623e6621f3
commit
eae839e484
@ -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
|
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
|
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:
|
build-linux-arm64:
|
||||||
FROM +code-linux
|
FROM +code-linux
|
||||||
RUN cargo zigbuild --target aarch64-unknown-linux-gnu --release -p veilid-server -p veilid-cli -p veilid-tools -p veilid-core
|
RUN cargo zigbuild --target aarch64-unknown-linux-gnu --release -p veilid-server -p veilid-cli -p veilid-tools -p veilid-core
|
||||||
|
@ -214,8 +214,7 @@ impl Envelope {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Decompress body
|
// Decompress body
|
||||||
let body = decompress_size_prepended(&body)
|
let body = decompress_size_prepended(&body, Some(MAX_ENVELOPE_SIZE))?;
|
||||||
.map_err(|e| VeilidAPIError::parse_error("failed to decompress", e))?;
|
|
||||||
|
|
||||||
Ok(body)
|
Ok(body)
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,6 @@ use cfg_if::*;
|
|||||||
use enumset::*;
|
use enumset::*;
|
||||||
use eyre::{bail, eyre, Report as EyreReport, Result as EyreResult, WrapErr};
|
use eyre::{bail, eyre, Report as EyreReport, Result as EyreResult, WrapErr};
|
||||||
use futures_util::stream::FuturesUnordered;
|
use futures_util::stream::FuturesUnordered;
|
||||||
use lz4_flex::block::{compress_prepend_size, decompress_size_prepended};
|
|
||||||
use parking_lot::*;
|
use parking_lot::*;
|
||||||
use schemars::{schema_for, JsonSchema};
|
use schemars::{schema_for, JsonSchema};
|
||||||
use serde::*;
|
use serde::*;
|
||||||
|
@ -147,10 +147,10 @@ impl TableDB {
|
|||||||
(&data[0..NONCE_LENGTH]).try_into().unwrap(),
|
(&data[0..NONCE_LENGTH]).try_into().unwrap(),
|
||||||
&di.key,
|
&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()))
|
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
||||||
} else {
|
} else {
|
||||||
decompress_size_prepended(data)
|
decompress_size_prepended(data, None)
|
||||||
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,3 +5,5 @@ pub mod serialize_arc;
|
|||||||
mod serialize_json;
|
mod serialize_json;
|
||||||
pub mod serialize_range_set_blaze;
|
pub mod serialize_range_set_blaze;
|
||||||
pub use serialize_json::*;
|
pub use serialize_json::*;
|
||||||
|
mod compression;
|
||||||
|
pub use compression::*;
|
||||||
|
Loading…
Reference in New Issue
Block a user