Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ namespace Aws
* If not set, the max of `partSize` and 5 MiB will be used.
*/
size_t multipartUploadThreshold{0};

/**
* Optional.
* THIS IS AN EXPERIMENTAL AND UNSTABLE API
* This setting maps to CRT's network_interface_names_array config.
*/
Aws::Vector<Aws::String> networkInterfaceNames;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: default empty vec {}

/* End of S3 CRT specifics */
private:
void LoadS3CrtSpecificConfig(const Aws::String& profileName);
Expand Down
12 changes: 12 additions & 0 deletions generated/src/aws-cpp-sdk-s3-crt/source/S3CrtClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,18 @@ void S3CrtClient::init(const S3Crt::ClientConfiguration& config,
s3CrtConfig.factory_user_data = static_cast<void *>(&m_identityProviderUserData);
s3CrtConfig.s3express_provider_override_factory = S3CrtIdentityProviderAdapter::ProviderFactory;

UniqueArrayPtr<aws_byte_cursor> interfacesNameCRTArr;
if (!config.networkInterfaceNames.empty())
{
interfacesNameCRTArr = Aws::MakeUniqueArray<aws_byte_cursor>(config.networkInterfaceNames.size(), ALLOCATION_TAG);
for(size_t i = 0; i < config.networkInterfaceNames.size(); ++i)
{
interfacesNameCRTArr.get()[i] = Crt::ByteCursorFromCString(config.networkInterfaceNames[i].c_str());
}
s3CrtConfig.network_interface_names_array = interfacesNameCRTArr.get();
s3CrtConfig.num_network_interface_names = config.networkInterfaceNames.size();
}

m_s3CrtClient = aws_s3_client_new(Aws::get_aws_allocator(), &s3CrtConfig);
if (!m_s3CrtClient)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,11 @@
* If not set, the max of `partSize` and 5 MiB will be used.
*/
size_t multipartUploadThreshold{0};

/**
* Optional.
* THIS IS AN EXPERIMENTAL AND UNSTABLE API
* This setting maps to CRT's network_interface_names_array config.
*/
Aws::Vector<Aws::String> networkInterfaceNames;
/* End of S3 CRT specifics */
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ void ${className}::init(const ${clientConfigurationNamespace}::ClientConfigurati
s3CrtConfig.factory_user_data = static_cast<void *>(&m_identityProviderUserData);
s3CrtConfig.s3express_provider_override_factory = S3CrtIdentityProviderAdapter::ProviderFactory;

UniqueArrayPtr<aws_byte_cursor> interfacesNameCRTArr;
if (!config.networkInterfaceNames.empty())
{
interfacesNameCRTArr = Aws::MakeUniqueArray<aws_byte_cursor>(config.networkInterfaceNames.size(), ALLOCATION_TAG);
for(size_t i = 0; i < config.networkInterfaceNames.size(); ++i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is good, may c++ std transform will make less code.

{
interfacesNameCRTArr.get()[i] = Crt::ByteCursorFromCString(config.networkInterfaceNames[i].c_str());
}
s3CrtConfig.network_interface_names_array = interfacesNameCRTArr.get();
s3CrtConfig.num_network_interface_names = config.networkInterfaceNames.size();
}

m_s3CrtClient = aws_s3_client_new(Aws::get_aws_allocator(), &s3CrtConfig);
if (!m_s3CrtClient)
{
Expand Down
Loading