You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/24 16:40:15 UTC
[GitHub] [arrow] pitrou commented on a change in pull request #8261: ARROW-10085: [C++] Fix S3 region resolution on Windows
pitrou commented on a change in pull request #8261:
URL: https://github.com/apache/arrow/pull/8261#discussion_r494460508
##########
File path: cpp/src/arrow/filesystem/s3fs.cc
##########
@@ -459,6 +459,24 @@ class S3Client : public Aws::S3::S3Client {
}
};
+// In AWS SDK < 1.8, Aws::Client::ClientConfiguration is a bool.
+// In AWS SDK >= 1.8, it's a Aws::Client::FollowRedirectsPolicy scoped enum.
+static constexpr bool HaveLegacyFollowRedirects =
+ std::is_same<bool,
+ decltype(Aws::Client::ClientConfiguration().followRedirects)>::value;
+
+template <typename Config = Aws::Client::ClientConfiguration>
+void DisableRedirects(
+ typename std::enable_if<HaveLegacyFollowRedirects, Config*>::type config) {
+ config->followRedirects = false;
+}
+
+template <typename Config = Aws::Client::ClientConfiguration>
+void DisableRedirects(
+ typename std::enable_if<!HaveLegacyFollowRedirects, Config*>::type config) {
+ config->followRedirects = decltype(config->followRedirects)::NEVER;
+}
+
Review comment:
I couldn't think of anything better. @bkietz
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org