Merge pull request #168 from kahing/fix-v4-host-endpoint

switch to use region specific endpoints to compute correct v4 signature
This commit is contained in:
Takeshi Nakatani 2015-04-18 18:02:45 +09:00
commit 30152284cc

View File

@ -3102,6 +3102,13 @@ static int s3fs_check_service(void)
LOWSYSLOGPRINT(LOG_ERR, "Could not connect wrong region %s, so retry to connect region %s.", endpoint.c_str(), expectregion.c_str());
FPRN("Could not connect wrong region %s, so retry to connect region %s.", endpoint.c_str(), expectregion.c_str());
endpoint = expectregion;
if (S3fsCurl::IsSignatureV4()) {
if (host == "http://s3.amazonaws.com") {
host = "http://s3-" + endpoint + ".amazonaws.com";
} else if (host == "https://s3.amazonaws.com") {
host = "https://s3-" + endpoint + ".amazonaws.com";
}
}
// retry to check
s3fscurl.DestroyCurlHandle();