Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 2612 #2618

Merged
merged 6 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -19,7 +19,7 @@ namespace Aws
{
struct AWS_S3CRT_API ClientConfiguration : Aws::S3Crt::S3CrtClientConfiguration
{
ClientConfiguration() : Aws::S3Crt::S3CrtClientConfiguration(),
ClientConfiguration(const Client::DefaultClientConfiguration &configuration = {}) : Aws::S3Crt::S3CrtClientConfiguration(configuration),
partSize(5 * 1024 * 1024),
throughputTargetGbps(2.0) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Aws
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration</*EndpointDiscoverySupported*/true>;

S3CrtClientConfiguration();
S3CrtClientConfiguration(const Client::DefaultClientConfiguration &configuration = {});

/**
* Create a configuration based on settings in the aws configuration file for the given profile name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void S3CrtClientConfiguration::LoadS3CrtSpecificConfig(const Aws::String& inputP
}
}

S3CrtClientConfiguration::S3CrtClientConfiguration()
: BaseClientConfigClass()
S3CrtClientConfiguration::S3CrtClientConfiguration(const Client::DefaultClientConfiguration &configuration)
: BaseClientConfigClass(configuration)
{
LoadS3CrtSpecificConfig(this->profileName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Aws
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration</*EndpointDiscoverySupported*/true>;

S3ClientConfiguration();
S3ClientConfiguration(const Client::DefaultClientConfiguration &configuration = {});

/**
* Create a configuration based on settings in the aws configuration file for the given profile name.
Expand Down
4 changes: 2 additions & 2 deletions generated/src/aws-cpp-sdk-s3/source/S3ClientConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void S3ClientConfiguration::LoadS3SpecificConfig(const Aws::String& inputProfile
}
}

S3ClientConfiguration::S3ClientConfiguration()
: BaseClientConfigClass()
S3ClientConfiguration::S3ClientConfiguration(const Client::DefaultClientConfiguration &configuration)
: BaseClientConfigClass(configuration)
{
LoadS3SpecificConfig(this->profileName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ namespace Aws
size_t requestMinCompressionSizeBytes = 10240;
};

struct DefaultClientConfiguration {
bool shouldDisableIMDS = false;
};

/**
* This mutable structure is used to configure any of the AWS clients.
* Default values can only be overwritten prior to passing to the client constructors.
*/
struct AWS_CORE_API ClientConfiguration
{
ClientConfiguration();
ClientConfiguration(const DefaultClientConfiguration &configuration = {});

/**
* Create a configuration based on settings in the aws configuration file for the given profile name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace Aws
{
static const bool EndpointDiscoverySupported = HasEndpointDiscovery;

GenericClientConfiguration()
: ClientConfiguration()
GenericClientConfiguration(const DefaultClientConfiguration &configuration = {})
: ClientConfiguration(configuration)
{}

/**
Expand Down Expand Up @@ -56,7 +56,7 @@ namespace Aws
{
static const bool EndpointDiscoverySupported = true;

GenericClientConfiguration();
GenericClientConfiguration(const DefaultClientConfiguration &configuration = {});
GenericClientConfiguration(const char* profileName, bool shouldDisableIMDS = false);
explicit GenericClientConfiguration(bool useSmartDefaults, const char* defaultMode = "legacy", bool shouldDisableIMDS = false);
GenericClientConfiguration(const ClientConfiguration& config);
Expand Down
4 changes: 2 additions & 2 deletions src/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ void setLegacyClientConfigurationParameters(ClientConfiguration& clientConfig)
}
}

ClientConfiguration::ClientConfiguration()
ClientConfiguration::ClientConfiguration(const DefaultClientConfiguration &configuration)
{
this->disableIMDS = false;
this->disableIMDS = configuration.shouldDisableIMDS;
setLegacyClientConfigurationParameters(*this);
retryStrategy = InitRetryStrategy();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ bool IsEndpointDiscoveryEnabled(const Aws::String& endpointOverride, const Aws::
return enabled;
}

GenericClientConfiguration<true>::GenericClientConfiguration()
: ClientConfiguration(),
GenericClientConfiguration<true>::GenericClientConfiguration(const DefaultClientConfiguration &configuration)
: ClientConfiguration(configuration),
enableHostPrefixInjection(ClientConfiguration::enableHostPrefixInjection),
enableEndpointDiscovery(ClientConfiguration::enableEndpointDiscovery)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace ${rootNamespace}
{
using BaseClientConfigClass = Aws::Client::GenericClientConfiguration<${EndpointDiscoveryTraitSupported}>;

${metadata.classNamePrefix}ClientConfiguration();
${metadata.classNamePrefix}ClientConfiguration(const Client::DefaultClientConfiguration &configuration = {});

/**
* Create a configuration based on settings in the aws configuration file for the given profile name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}Spec
#end
}

${metadata.classNamePrefix}ClientConfiguration::${metadata.classNamePrefix}ClientConfiguration()
: BaseClientConfigClass()
${metadata.classNamePrefix}ClientConfiguration::${metadata.classNamePrefix}ClientConfiguration(const Client::DefaultClientConfiguration &configuration)
: BaseClientConfigClass(configuration)
{
Load${serviceNamespace}SpecificConfig(this->profileName);
}
Expand Down
Loading