Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
houseme committed Dec 8, 2025
commit 0c526206d1d001deb8876aca81a426df774c9342
8 changes: 3 additions & 5 deletions crates/ecstore/src/client/api_get_object_acl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ use bytes::Bytes;
use http::{HeaderMap, HeaderValue};
use s3s::dto::Owner;
use std::collections::HashMap;
use std::io::Cursor;
use tokio::io::BufReader;

use crate::client::{
api_error_response::{err_invalid_argument, http_resp_to_error_response},
api_error_response::http_resp_to_error_response,
api_get_options::GetObjectOptions,
transition_api::{ObjectInfo, ReadCloser, ReaderImpl, RequestMetadata, TransitionClient, to_object_info},
transition_api::{ObjectInfo, ReaderImpl, RequestMetadata, TransitionClient},
};
use rustfs_utils::EMPTY_STRING_SHA256_HASH;

Expand Down Expand Up @@ -90,7 +88,7 @@ impl TransitionClient {
return Err(std::io::Error::other(http_resp_to_error_response(&resp, b, bucket_name, object_name)));
}

let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
let mut res = match quick_xml::de::from_str::<AccessControlPolicy>(&String::from_utf8(b).unwrap()) {
Ok(result) => result,
Err(err) => {
Expand Down
17 changes: 5 additions & 12 deletions crates/ecstore/src/client/api_get_object_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@
use bytes::Bytes;
use http::{HeaderMap, HeaderValue};
use std::collections::HashMap;
use std::io::Cursor;
use time::OffsetDateTime;
use tokio::io::BufReader;

use crate::client::constants::{GET_OBJECT_ATTRIBUTES_MAX_PARTS, GET_OBJECT_ATTRIBUTES_TAGS, ISO8601_DATEFORMAT};
use rustfs_utils::EMPTY_STRING_SHA256_HASH;
use s3s::header::{
X_AMZ_DELETE_MARKER, X_AMZ_MAX_PARTS, X_AMZ_METADATA_DIRECTIVE, X_AMZ_OBJECT_ATTRIBUTES, X_AMZ_PART_NUMBER_MARKER,
X_AMZ_REQUEST_CHARGED, X_AMZ_RESTORE, X_AMZ_VERSION_ID,
};
use s3s::{Body, dto::Owner};
use s3s::Body;
use s3s::header::{X_AMZ_MAX_PARTS, X_AMZ_OBJECT_ATTRIBUTES, X_AMZ_PART_NUMBER_MARKER, X_AMZ_VERSION_ID};

use crate::client::{
api_error_response::err_invalid_argument,
api_get_object_acl::AccessControlPolicy,
api_get_options::GetObjectOptions,
transition_api::{ObjectInfo, ReadCloser, ReaderImpl, RequestMetadata, TransitionClient, to_object_info},
transition_api::{ReaderImpl, RequestMetadata, TransitionClient},
};

pub struct ObjectAttributesOptions {
Expand Down Expand Up @@ -143,7 +136,7 @@ impl ObjectAttributes {
self.last_modified = mod_time;
self.version_id = h.get(X_AMZ_VERSION_ID).unwrap().to_str().unwrap().to_string();

let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
let mut response = match quick_xml::de::from_str::<ObjectAttributesResponse>(&String::from_utf8(b).unwrap()) {
Ok(result) => result,
Err(err) => {
Expand Down Expand Up @@ -224,7 +217,7 @@ impl TransitionClient {
}

if resp.status() != http::StatusCode::OK {
let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
let err_body = String::from_utf8(b).unwrap();
let mut er = match quick_xml::de::from_str::<AccessControlPolicy>(&err_body) {
Ok(result) => result,
Expand Down
2 changes: 1 addition & 1 deletion crates/ecstore/src/client/api_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl TransitionClient {
}

//let mut list_bucket_result = ListBucketV2Result::default();
let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
let mut list_bucket_result = match quick_xml::de::from_str::<ListBucketV2Result>(&String::from_utf8(b).unwrap()) {
Ok(result) => result,
Err(err) => {
Expand Down
9 changes: 3 additions & 6 deletions crates/ecstore/src/client/bucket_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@

use http::Request;
use hyper::StatusCode;
use hyper::body::Incoming;
use std::{collections::HashMap, sync::Arc};
use tracing::warn;
use tracing::{debug, error, info};
use std::collections::HashMap;

use crate::client::{
api_error_response::{http_resp_to_error_response, to_error_response},
api_error_response::http_resp_to_error_response,
transition_api::{CreateBucketConfiguration, LocationConstraint, TransitionClient},
};
use rustfs_utils::hash::EMPTY_STRING_SHA256_HASH;
Expand Down Expand Up @@ -212,7 +209,7 @@ async fn process_bucket_location_response(
}
//}

let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
let mut location = "".to_string();
if tier_type == "huaweicloud" {
let d = quick_xml::de::from_str::<CreateBucketConfiguration>(&String::from_utf8(b).unwrap()).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions crates/ecstore/src/client/transition_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl TransitionClient {
//if self.is_trace_enabled && !(self.trace_errors_only && resp.status() == StatusCode::OK) {
if resp.status() != StatusCode::OK {
//self.dump_http(&cloned_req, &resp)?;
let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
warn!("err_body: {}", String::from_utf8(b).unwrap());
}

Expand Down Expand Up @@ -334,7 +334,7 @@ impl TransitionClient {
}
}

let b = resp.body_mut().store_all_unlimited().await.unwrap().to_vec();
let b = resp.body_mut().store_all_limited(usize::MAX).await.unwrap().to_vec();
let mut err_response = http_resp_to_error_response(&resp, b.clone(), &metadata.bucket_name, &metadata.object_name);
err_response.message = format!("remote tier error: {}", err_response.message);

Expand Down
Loading