introduced 1 minute timeout for archive's files list building

This commit is contained in:
Massimo Melina 2020-06-28 13:57:53 +02:00
parent 6c5139d552
commit b1a95cd319
2 changed files with 7 additions and 1 deletions

View File

@ -848,10 +848,12 @@ var
var
i, posBak: int64;
n: integer;
begin
posBak:=pos;
p:=@buffer;
while (count > 0) and (cur < length(flist)) do
n:=length(flist);
while (count > 0) and (cur < n) do
case where of
TW_HEADER:
begin

View File

@ -1368,6 +1368,7 @@ type
actualCount: integer;
public
dir: array of Tfile;
timeout: TDateTime;
ignoreConnFilter: boolean;
constructor create();
destructor Destroy; override;
@ -1661,6 +1662,8 @@ this would let us have "=" inside the names, but names cannot be assigned
repeat
application.ProcessMessages();
cd.lastActivityTime:=now();
if cd.lastActivityTime > timeout then
break;
// we don't list these entries
if (sr.name = '.') or (sr.name = '..')
or isCommentFile(sr.name) or isFingerprintFile(sr.name) or sameText(sr.name, DIFF_TPL_FILE)
@ -5026,6 +5029,7 @@ var
listing:=TfileListing.create();
try
listing.ignoreConnFilter:=ignoreConnFilters;
listing.timeout:= now()+1/MINUTES;
listing.fromFolder( f, data, shouldRecur(data));
fIsTemp:=f.isTemp();
ofs:=length(f.resource)-length(f.name)+1;