瀏覽代碼

Bug 1871: Workaround for lack of support for max-keys parameter in Backblaze S3 API

https://winscp.net/tracker/1871

Source commit: 264b77de5ef7328fa3ccbdc2681bad8a0d4ad395
Martin Prikryl 5 年之前
父節點
當前提交
0a10ee2f87
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      source/core/S3FileSystem.cpp

+ 6 - 0
source/core/S3FileSystem.cpp

@@ -876,6 +876,12 @@ void TS3FileSystem::ReadDirectoryInternal(
 
       Retry = false;
 
+      // Backblack S3 API does not support "maxkeys" for bucket list
+      if (EndsText(L".backblazeb2.com", FTerminal->SessionData->HostNameExpanded))
+      {
+        MaxKeys = 0;
+      }
+
       S3_list_service(
         FLibS3Protocol, FAccessKeyId.c_str(), FSecretAccessKey.c_str(), 0, (FHostName + FPortSuffix).c_str(),
         StrToS3(FAuthRegion), MaxKeys, FRequestContext, FTimeout, &ListServiceHandler, &Data);