mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
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
|
||||
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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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::*;
|
||||
|
@ -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()))
|
||||
}
|
||||
}
|
||||
|
@ -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::*;
|
||||
|
Loading…
Reference in New Issue
Block a user