Skip to content

Commit

Permalink
Bug 1946: Hang when S3 server returns a truncated listing with folder…
Browse files Browse the repository at this point in the history
…s only (2nd)

(cherry picked from commit 4074788)

Source commit: fcaf8e7e837c0e83fb1dd097b2df31a1519d152b
  • Loading branch information
martinprikryl committed Jan 27, 2021
1 parent d71684b commit 595281e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/core/S3FileSystem.cpp
Expand Up @@ -877,6 +877,7 @@ void TS3FileSystem::ReadDirectoryInternal(
const UnicodeString & APath, TRemoteFileList * FileList, int MaxKeys, const UnicodeString & FileName)
{
UnicodeString Path = UnixExcludeTrailingBackslash(AbsolutePath(APath, false));
int AMaxKeys = (MaxKeys == -1) ? 1 : MaxKeys;
if (IsUnixRootPath(Path))
{
DebugAssert(FileList != NULL);
Expand All @@ -901,7 +902,6 @@ void TS3FileSystem::ReadDirectoryInternal(
MaxKeys = 0;
}

int AMaxKeys = (MaxKeys == -1) ? 1 : MaxKeys;
S3_list_service(
FLibS3Protocol, FAccessKeyId.c_str(), FSecretAccessKey.c_str(), FSecurityToken, (FHostName + FPortSuffix).c_str(),
StrToS3(FAuthRegion), AMaxKeys, FRequestContext, FTimeout, &ListServiceHandler, &Data);
Expand All @@ -928,7 +928,7 @@ void TS3FileSystem::ReadDirectoryInternal(

do
{
DoListBucket(Prefix, FileList, MaxKeys, BucketContext, Data);
DoListBucket(Prefix, FileList, AMaxKeys, BucketContext, Data);
CheckLibS3Error(Data);

Continue = false;
Expand Down

0 comments on commit 595281e

Please sign in to comment.