You are not logged in.
Pages: 1
Ctxt = nil
procedure TSQLRestServer.SessionDelete(aSessionIndex: integer;
Ctxt: TSQLRestServerURIContext);
...
{$ifdef WITHLOG}
if Assigned(User) then
Ctxt.Log.Log(sllUserAuth,'Deleted session %/% from %/%', <---------------------------------------------- Ctxt = nil
[User.LogonName,IDCardinal,RemoteIP,ConnectionID],self);
{$endif}
When SessionDelete function is called from TSQLRestServer.SessionAccess, the Ctxt - is nil
function TSQLRestServer.SessionAccess(Ctxt: TSQLRestServerURIContext): TAuthSession;
var i: integer;
Tix64: Int64;
begin // caller shall be locked via fSessionCriticalSection
if (self<>nil) and (fSessions<>nil) then begin
// first check for outdated sessions to be deleted
Tix64 := GetTickCount64;
for i := fSessions.Count-1 downto 0 do
with TAuthSession(fSessions.List[i]) do
if Tix64>LastAccess64+TimeOutMS then
SessionDelete(i,nil); <------------------------------------------------------------------ Ctxt - nil
// retrieve session
for i := 0 to fSessions.Count-1 do begin
result := TAuthSession(fSessions.List[i]);
if result.IDCardinal=Ctxt.Session then begin
result.fLastAccess64 := Tix64; // refresh session access timestamp
Ctxt.SessionUser := result.User.fID;
Ctxt.SessionGroup := result.User.GroupRights.fID;
Ctxt.SessionUserName := result.User.LogonName;
Ctxt.SessionRemoteIP := result.RemoteIP;
Ctxt.SessionConnectionID := result.ConnectionID;
exit;
end;
end;
end;
result := nil;
end;
Offline
Should be fixed by http://synopse.info/fossil/info/18756fee3e
Thanks for the feedback!
Offline
This error still occurs:
procedure TSQLRestServer.SessionDelete(aSessionIndex: integer;
Ctxt: TSQLRestServerURIContext);
begin
if (self<>nil) and (cardinal(aSessionIndex)<cardinal(fSessions.Count)) then
with TAuthSession(fSessions.List[aSessionIndex]) do begin
if Services is TServiceContainerServer then
TServiceContainerServer(Services).OnCloseSession(IDCardinal);
{$ifdef WITHLOG}
fLogFamily.SynLog.Log(sllUserAuth,'Deleted session %/% from %/%',
[User.LogonName,IDCardinal,RemoteIP,Ctxt.Call^.LowLevelConnectionID],self); //<------ Ctxt = nil -> SessionDelete(i,nil); in function TSQLRestServer.SessionAccess(Ctxt: TSQLRestServerURIContext): TAuthSession;
{$endif}
if Assigned(OnSessionClosed) then
OnSessionClosed(self,fSessions.List[aSessionIndex],Ctxt);
fSessions.Delete(aSessionIndex);
fStats.ClientDisconnect;
end;
end;
Offline
Yes the issue has been reintroduced by another in-between commit.
Should be fixed by http://synopse.info/fossil/info/a2636421a5
Thanks for the feedback.
Offline
Pages: 1