From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox] s3-client: make truncation flag optional in list object v2 response
Date: Wed, 7 Jan 2026 13:07:57 +0100 [thread overview]
Message-ID: <20260107120757.346517-1-c.ebner@proxmox.com> (raw)
Some providers do not return the `IsTruncated` flag [0] in the
response body for list object v2 API calls, signaling that there are
further object keys to be returned by subsequent API calls providing
the next continuation token.
Since this flag is optional, allow it to be missing for XML response
body parsing and default for it to be false in the client response.
Other unused members for the struct used for XML parsing have already
been dropped in commit eb559d87 ("fix #7008: s3-client: drop unused
optional object list v2 response fields").
Fixes: https://forum.proxmox.com/threads/178707/
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
proxmox-s3-client/src/response_reader.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proxmox-s3-client/src/response_reader.rs b/proxmox-s3-client/src/response_reader.rs
index 47fcd129..e03b3bb0 100644
--- a/proxmox-s3-client/src/response_reader.rs
+++ b/proxmox-s3-client/src/response_reader.rs
@@ -37,7 +37,7 @@ pub struct ListObjectsV2Response {
/// https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_ResponseSyntax
struct ListObjectsV2ResponseBody {
/// Flag indication if response was truncated because of key limits.
- pub is_truncated: bool,
+ pub is_truncated: Option<bool>,
/// Token used for this request to get further keys in truncated responses.
pub continuation_token: Option<String>,
/// Allows to fetch the next set of keys for truncated responses.
@@ -50,7 +50,7 @@ impl ListObjectsV2ResponseBody {
fn with_optional_date(self, date: Option<HttpDate>) -> ListObjectsV2Response {
ListObjectsV2Response {
date,
- is_truncated: self.is_truncated,
+ is_truncated: self.is_truncated.unwrap_or_default(),
continuation_token: self.continuation_token,
next_continuation_token: self.next_continuation_token,
contents: self.contents.unwrap_or_default(),
@@ -530,7 +530,7 @@ fn parse_list_objects_v2_response_test() {
</ListBucketResult>
"#;
let result: ListObjectsV2ResponseBody = serde_xml_rs::from_str(response_body).unwrap();
- assert!(!result.is_truncated);
+ assert_eq!(result.is_truncated, Some(false));
assert_eq!(
result.contents.unwrap(),
vec![
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
reply other threads:[~2026-01-07 12:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260107120757.346517-1-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.