aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
diff options
context:
space:
mode:
authordakovalkov <dakovalkov@yandex-team.com>2023-12-03 13:33:55 +0300
committerdakovalkov <dakovalkov@yandex-team.com>2023-12-03 14:04:39 +0300
commit2a718325637e5302334b6d0a6430f63168f8dbb3 (patch)
tree64be81080b7df9ec1d86d053a0c394ae53fcf1fe /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
parente0d94a470142d95c3007e9c5d80380994940664a (diff)
downloadydb-2a718325637e5302334b6d0a6430f63168f8dbb3.tar.gz
Update contrib/libs/aws-sdk-cpp to 1.11.37
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp45
1 files changed, 41 insertions, 4 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
index 0711fd69d6..4fd97618f3 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/Aws.cpp
@@ -7,6 +7,7 @@
#include <aws/core/Aws.h>
#include <aws/core/client/CoreErrors.h>
#include <aws/core/utils/logging/AWSLogging.h>
+#include <aws/core/utils/logging/CRTLogging.h>
#include <aws/core/utils/logging/DefaultLogSystem.h>
#include <aws/core/Globals.h>
#include <aws/core/external/cjson/cJSON.h>
@@ -27,6 +28,7 @@ namespace Aws
Aws::Utils::Memory::InitializeAWSMemorySystem(*options.memoryManagementOptions.memoryManager);
}
#endif // USE_AWS_MEMORY_MANAGEMENT
+ Aws::InitializeCrt();
Aws::Client::CoreErrorsMapper::InitCoreErrorsMapper();
if(options.loggingOptions.logLevel != Aws::Utils::Logging::LogLevel::Off)
{
@@ -39,12 +41,46 @@ namespace Aws
Aws::Utils::Logging::InitializeAWSLogging(
Aws::MakeShared<Aws::Utils::Logging::DefaultLogSystem>(ALLOCATION_TAG, options.loggingOptions.logLevel, options.loggingOptions.defaultLogPrefix));
}
+ if(options.loggingOptions.crt_logger_create_fn)
+ {
+ Aws::Utils::Logging::InitializeCRTLogging(options.loggingOptions.crt_logger_create_fn());
+ }
+ else
+ {
+ Aws::Utils::Logging::InitializeCRTLogging(
+ Aws::MakeShared<Aws::Utils::Logging::DefaultCRTLogSystem>(ALLOCATION_TAG, options.loggingOptions.logLevel));
+ }
// For users to better debugging in case multiple versions of SDK installed
AWS_LOGSTREAM_INFO(ALLOCATION_TAG, "Initiate AWS SDK for C++ with Version:" << Aws::String(Aws::Version::GetVersionString()));
}
Aws::Config::InitConfigAndCredentialsCacheManager();
+ if (options.ioOptions.clientBootstrap_create_fn)
+ {
+ Aws::SetDefaultClientBootstrap(options.ioOptions.clientBootstrap_create_fn());
+ }
+ else
+ {
+ Aws::Crt::Io::EventLoopGroup eventLoopGroup;
+ Aws::Crt::Io::DefaultHostResolver defaultHostResolver(eventLoopGroup, 8, 30);
+ auto clientBootstrap = Aws::MakeShared<Aws::Crt::Io::ClientBootstrap>(ALLOCATION_TAG, eventLoopGroup, defaultHostResolver);
+ clientBootstrap->EnableBlockingShutdown();
+ Aws::SetDefaultClientBootstrap(clientBootstrap);
+ }
+
+ if (options.ioOptions.tlsConnectionOptions_create_fn)
+ {
+ Aws::SetDefaultTlsConnectionOptions(options.ioOptions.tlsConnectionOptions_create_fn());
+ }
+ else
+ {
+ Aws::Crt::Io::TlsContextOptions tlsCtxOptions = Aws::Crt::Io::TlsContextOptions::InitDefaultClient();
+ Aws::Crt::Io::TlsContext tlsContext(tlsCtxOptions, Aws::Crt::Io::TlsMode::CLIENT);
+ auto tlsConnectionOptions = Aws::MakeShared<Aws::Crt::Io::TlsConnectionOptions>(ALLOCATION_TAG, tlsContext.NewConnectionOptions());
+ Aws::SetDefaultTlsConnectionOptions(tlsConnectionOptions);
+ }
+
if (options.cryptoOptions.aes_CBCFactory_create_fn)
{
Aws::Utils::Crypto::SetAES_CBCFactory(options.cryptoOptions.aes_CBCFactory_create_fn());
@@ -100,6 +136,7 @@ namespace Aws
Aws::Http::SetInitCleanupCurlFlag(options.httpOptions.initAndCleanupCurl);
Aws::Http::SetInstallSigPipeHandlerFlag(options.httpOptions.installSigPipeHandler);
+ Aws::Http::SetCompliantRfc3986Encoding(options.httpOptions.compliantRfc3986Encoding);
Aws::Http::InitHttp();
Aws::InitializeEnumOverflowContainer();
cJSON_AS4CPP_Hooks hooks;
@@ -122,13 +159,13 @@ namespace Aws
Aws::Config::CleanupConfigAndCredentialsCacheManager();
- if(options.loggingOptions.logLevel != Aws::Utils::Logging::LogLevel::Off)
+ Aws::Client::CoreErrorsMapper::CleanupCoreErrorsMapper();
+ Aws::CleanupCrt();
+ if (options.loggingOptions.logLevel != Aws::Utils::Logging::LogLevel::Off)
{
+ Aws::Utils::Logging::ShutdownCRTLogging();
Aws::Utils::Logging::ShutdownAWSLogging();
}
-
- Aws::Client::CoreErrorsMapper::CleanupCoreErrorsMapper();
-
#ifdef USE_AWS_MEMORY_MANAGEMENT
if(options.memoryManagementOptions.memoryManager)
{