# HG changeset patch # User Alain Mazy # Date 1594284044 -7200 # Node ID 393fcf337462e6829113297eb9a6e317d7325baf # Parent 4e326cea533eac307d31fc378e4812a80f538165 AWS: added 3 configurations: Endpoint, ConnectionTimeout, RequestTimeout diff -r 4e326cea533e -r 393fcf337462 Aws/AwsS3StoragePlugin.cpp --- a/Aws/AwsS3StoragePlugin.cpp Fri Jul 03 15:43:20 2020 +0200 +++ b/Aws/AwsS3StoragePlugin.cpp Thu Jul 09 10:40:44 2020 +0200 @@ -217,6 +217,10 @@ return nullptr; } + std::string endpoint = pluginSection.GetStringValue("Endpoint", ""); + unsigned int connectTimeout = pluginSection.GetUnsignedIntegerValue("ConnectTimeout", 30); + unsigned int requestTimeout = pluginSection.GetUnsignedIntegerValue("RequestTimeout", 1200); + try { Aws::SDKOptions options; @@ -225,6 +229,15 @@ Aws::Auth::AWSCredentials credentials(accessKey.c_str(), secretKey.c_str()); Aws::Client::ClientConfiguration configuration; configuration.region = region.c_str(); + configuration.scheme = Aws::Http::Scheme::HTTPS; + configuration.connectTimeoutMs = connectTimeout * 1000; + configuration.requestTimeoutMs = requestTimeout * 1000; + + if (!endpoint.empty()) + { + configuration.endpointOverride = endpoint.c_str(); + } + Aws::S3::S3Client client(credentials, configuration); OrthancPlugins::LogInfo("AWS S3 storage initialized"); diff -r 4e326cea533e -r 393fcf337462 NEWS --- a/NEWS Fri Jul 03 15:43:20 2020 +0200 +++ b/NEWS Thu Jul 09 10:40:44 2020 +0200 @@ -1,8 +1,7 @@ Pending changes in the mainline =============================== -None - +* AWS: added 3 configurations: Endpoint, ConnectionTimeout, RequestTimeout 2020-07-03 - v 0.9.0 ==================== diff -r 4e326cea533e -r 393fcf337462 README.md --- a/README.md Fri Jul 03 15:43:20 2020 +0200 +++ b/README.md Thu Jul 09 10:40:44 2020 +0200 @@ -100,6 +100,9 @@ "BucketName": "test-orthanc-s3-plugin", "Region" : "eu-central-1", "AccessKey" : "AKXXX", - "SecretKey" : "RhYYYY" + "SecretKey" : "RhYYYY", + "Endpoint": "", // optional: custom endpoint + "ConnectionTimeout": 30, // optional: connection timeout in seconds + "RequestTimeout": 1200 // optional: request timeout in seconds (max time to upload/download a file) } ``` \ No newline at end of file