You are not logged in.
@ab:
SessionDeleteDeprecated returns the system tix count number in second resolution.
But why is this result increased every time when a deprecated session is found and deleted within the loop below?
IMHO „inc(result)“ should be deleted as this line will change the deletion condition for each next session item in fSessions.List.
Or am I missing something?
Thanks a lot!
Paul
function TRestServer.SessionDeleteDeprecated: cardinal;
...
begin // caller made fSessions.Safe.Lock
result := GetTickCount64 shr 10;
if (self <> nil) and
...
fSessionsDeprecatedTix := result;
for i := fSessions.Count - 1 downto 0 do
if result > TAuthSession(fSessions.List[i]).TimeOutTix then
begin
SessionDelete(i, nil);
inc(result); // <== why increasing result within this loop?
end;
end;
end;
Offline
This is indeed a bug.
The initial design returned the number of deleted session.
But it is not a big issue, since it would just add a few seconds to the new session timeout.
See https://synopse.info/fossil/info/72d60cc313
Thanks for the feedback!
Offline