ソースを参照

Bug 2027: When S3 authentication region changes during session, previously visited buckets from the original authentication region could not be accessed anymore

https://winscp.net/tracker/2027
(cherry picked from commit 4cfde8e487863446d1c56abd835d8a9b0bf55818)

Source commit: 177ab68c7e7d69ea13e0d92b55dbdd8f818bb9f2
Martin Prikryl 4 年 前
コミット
6be97ec454
1 ファイル変更2 行追加6 行削除
  1. 2 6
      source/core/S3FileSystem.cpp

+ 2 - 6
source/core/S3FileSystem.cpp

@@ -593,10 +593,6 @@ TLibS3BucketContext TS3FileSystem::GetBucketContext(const UnicodeString & Bucket
     if (I != FRegions.end())
     {
       Region = I->second;
-      if (Region.IsEmpty())
-      {
-        Region = FAuthRegion;
-      }
     }
     else
     {
@@ -678,8 +674,8 @@ TLibS3BucketContext TS3FileSystem::GetBucketContext(const UnicodeString & Bucket
       // Minio
       else if (Data.Status == S3StatusOK)
       {
-        FTerminal->LogEvent(FORMAT("Will use default region for bucket \"%s\" from now on.", (BucketName)));
-        FRegions.insert(std::make_pair(BucketName, UnicodeString()));
+        FTerminal->LogEvent(FORMAT("Will keep using region \"%s\" for bucket \"%s\" from now on.", (FAuthRegion, BucketName)));
+        FRegions.insert(std::make_pair(BucketName, FAuthRegion));
       }
     }
   }