s3 fixes
This commit is contained in:
parent
7faf648919
commit
329ba1d5e4
@ -320,7 +320,10 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
long response_code{};
|
long response_code{};
|
||||||
auto prefix = object_name.empty() ? object_name : object_name + "/";
|
auto prefix = object_name.empty() ? object_name : object_name + "/";
|
||||||
|
|
||||||
if (not get_object_list(response_data, response_code, "/", prefix)) {
|
auto grab_more{true};
|
||||||
|
std::string token{};
|
||||||
|
while (grab_more) {
|
||||||
|
if (not get_object_list(response_data, response_code, "/", prefix, token)) {
|
||||||
return api_error::comm_error;
|
return api_error::comm_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,8 +343,20 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grab_more = doc.select_node("/ListBucketResult/IsTruncated")
|
||||||
|
.node()
|
||||||
|
.text()
|
||||||
|
.as_bool();
|
||||||
|
if (grab_more) {
|
||||||
|
token = doc.select_node("/ListBucketResult/NextContinuationToken")
|
||||||
|
.node()
|
||||||
|
.text()
|
||||||
|
.as_string();
|
||||||
|
}
|
||||||
|
|
||||||
const auto add_directory_item =
|
const auto add_directory_item =
|
||||||
[&](bool directory, const std::string &name, std::uint64_t last_modified,
|
[&](bool directory, const std::string &name,
|
||||||
|
std::uint64_t last_modified,
|
||||||
std::function<std::uint64_t(const directory_item &)> get_size)
|
std::function<std::uint64_t(const directory_item &)> get_size)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
auto child_api_path =
|
auto child_api_path =
|
||||||
@ -387,7 +402,8 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
return api_error::success;
|
return api_error::success;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto node_list = doc.select_nodes("/ListBucketResult/CommonPrefixes/Prefix");
|
auto node_list =
|
||||||
|
doc.select_nodes("/ListBucketResult/CommonPrefixes/Prefix");
|
||||||
for (auto &&node : node_list) {
|
for (auto &&node : node_list) {
|
||||||
add_directory_item(
|
add_directory_item(
|
||||||
true, node.node().text().as_string(), 0U,
|
true, node.node().text().as_string(), 0U,
|
||||||
@ -411,6 +427,7 @@ auto s3_provider::get_directory_items_impl(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user