From 278bf4d9ab0751dfe4041188a4a8e5e44c1dc746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Hanuszczak?= Date: Tue, 10 Mar 2026 18:48:53 +0100 Subject: [PATCH 1/2] Drop length limit in `get_file_contents`. --- crates/rrg/src/action/get_file_contents.rs | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/crates/rrg/src/action/get_file_contents.rs b/crates/rrg/src/action/get_file_contents.rs index f796b944..191cc0ad 100644 --- a/crates/rrg/src/action/get_file_contents.rs +++ b/crates/rrg/src/action/get_file_contents.rs @@ -137,11 +137,6 @@ impl crate::request::Args for Args { let len = match proto.length() { 0 => usize::MAX, - len if len > MAX_BLOB_LEN as u64 => { - return Err(ParseArgsError::invalid_field("length", LenError { - len, - })); - } len => len as usize, }; @@ -213,26 +208,6 @@ impl std::fmt::Display for FileErrorKind { } } -/// An error indicating that the action was invoked with invalid length. -#[derive(Debug)] -struct LenError { - len: u64, -} - -impl std::fmt::Display for LenError { - - fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { - write! { - fmt, - "provided length ({}) is bigger than allowed ({})", - self.len, MAX_BLOB_LEN - } - } -} - -impl std::error::Error for LenError { -} - #[cfg(test)] mod tests { From 5a413068f0fff87d4ac075aa94237135aad7a8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Hanuszczak?= Date: Tue, 10 Mar 2026 18:51:24 +0100 Subject: [PATCH 2/2] Drop length limit in `get_file_contents_kmx`. --- .../rrg/src/action/get_file_contents_kmx.rs | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/crates/rrg/src/action/get_file_contents_kmx.rs b/crates/rrg/src/action/get_file_contents_kmx.rs index 0257362a..4edad9d1 100644 --- a/crates/rrg/src/action/get_file_contents_kmx.rs +++ b/crates/rrg/src/action/get_file_contents_kmx.rs @@ -254,11 +254,6 @@ impl crate::request::Args for Args { let len = match proto.length() { 0 => usize::MAX, - len if len > MAX_BLOB_LEN as u64 => { - return Err(ParseArgsError::invalid_field("length", LenError { - len, - })); - }, len => len as usize, }; @@ -346,26 +341,6 @@ impl std::fmt::Display for FileErrorKind { } } -/// An error indicating that the action was invoked with invalid length. -#[derive(Debug)] -struct LenError { - len: u64, -} - -impl std::fmt::Display for LenError { - - fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { - write! { - fmt, - "provided length ({}) is bigger than allowed ({})", - self.len, MAX_BLOB_LEN - } - } -} - -impl std::error::Error for LenError { -} - #[cfg(test)] mod tests {