mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
introduced 1 minute timeout for archive's files list building
This commit is contained in:
parent
6c5139d552
commit
b1a95cd319
@ -848,10 +848,12 @@ var
|
|||||||
|
|
||||||
var
|
var
|
||||||
i, posBak: int64;
|
i, posBak: int64;
|
||||||
|
n: integer;
|
||||||
begin
|
begin
|
||||||
posBak:=pos;
|
posBak:=pos;
|
||||||
p:=@buffer;
|
p:=@buffer;
|
||||||
while (count > 0) and (cur < length(flist)) do
|
n:=length(flist);
|
||||||
|
while (count > 0) and (cur < n) do
|
||||||
case where of
|
case where of
|
||||||
TW_HEADER:
|
TW_HEADER:
|
||||||
begin
|
begin
|
||||||
|
|||||||
4
main.pas
4
main.pas
@ -1368,6 +1368,7 @@ type
|
|||||||
actualCount: integer;
|
actualCount: integer;
|
||||||
public
|
public
|
||||||
dir: array of Tfile;
|
dir: array of Tfile;
|
||||||
|
timeout: TDateTime;
|
||||||
ignoreConnFilter: boolean;
|
ignoreConnFilter: boolean;
|
||||||
constructor create();
|
constructor create();
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -1661,6 +1662,8 @@ this would let us have "=" inside the names, but names cannot be assigned
|
|||||||
repeat
|
repeat
|
||||||
application.ProcessMessages();
|
application.ProcessMessages();
|
||||||
cd.lastActivityTime:=now();
|
cd.lastActivityTime:=now();
|
||||||
|
if cd.lastActivityTime > timeout then
|
||||||
|
break;
|
||||||
// we don't list these entries
|
// we don't list these entries
|
||||||
if (sr.name = '.') or (sr.name = '..')
|
if (sr.name = '.') or (sr.name = '..')
|
||||||
or isCommentFile(sr.name) or isFingerprintFile(sr.name) or sameText(sr.name, DIFF_TPL_FILE)
|
or isCommentFile(sr.name) or isFingerprintFile(sr.name) or sameText(sr.name, DIFF_TPL_FILE)
|
||||||
@ -5026,6 +5029,7 @@ var
|
|||||||
listing:=TfileListing.create();
|
listing:=TfileListing.create();
|
||||||
try
|
try
|
||||||
listing.ignoreConnFilter:=ignoreConnFilters;
|
listing.ignoreConnFilter:=ignoreConnFilters;
|
||||||
|
listing.timeout:= now()+1/MINUTES;
|
||||||
listing.fromFolder( f, data, shouldRecur(data));
|
listing.fromFolder( f, data, shouldRecur(data));
|
||||||
fIsTemp:=f.isTemp();
|
fIsTemp:=f.isTemp();
|
||||||
ofs:=length(f.resource)-length(f.name)+1;
|
ofs:=length(f.resource)-length(f.name)+1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user