mORMot and Open Source friends
Check-in [18756fee3e]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixed GPF regression issue TSQLRestServer.SessionDelete()
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 18756fee3ec474e3a22a241296131f2766db50aa
User & Date: User 2014-08-28 11:20:38
Context
2014-08-28
16:54
added TSQLInitializeTableOptions parameter to TSQLRestServer.CreateMissingTables and TSQLRecord.InitializeTable methods, to tune underlying table creation (e.g. disable indexes creation) check-in: c7717b0ff9 user: User tags: trunk
11:20
fixed GPF regression issue TSQLRestServer.SessionDelete() check-in: 18756fee3e user: User tags: trunk
11:16
added a new BatchOptions parameter to TSQLRest.BatchStart() - by now, there is only boInsertIgnore which will use INSERT OR IGNORE instead of plain INSERT for BatchAdd() process, and it will work only for SQLite3 internal engine (i.e. mORMotSQLite3), not external DB, since other databases may have a very diverse syntax check-in: 1a2240656a user: User tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SQLite3/mORMot.pas.

27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
.....
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
  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}
    Ctxt.Log.Log(sllUserAuth,'Deleted session %/% from %/%',
      [User.LogonName,IDCardinal,RemoteIP,ConnectionID],self);
    {$endif}
    if Assigned(OnSessionClosed) then
      OnSessionClosed(self,fSessions.List[aSessionIndex],Ctxt);
    fSessions.Delete(aSessionIndex);
    fStats.ClientDisconnect;
  end;
................................................................................

function TSQLRestServerAuthentication.GetUser(Ctxt: TSQLRestServerURIContext;
  const aUserName: RawUTF8): TSQLAuthUser;
begin
  result := fServer.fSQLAuthUserClass.Create(fServer,'LogonName=?',[aUserName]);
  if result.fID=0 then begin
    {$ifdef WITHLOG}
    Ctxt.Log.Log(sllUserAuth,
      'User.LogonName=% not found in AuthUser table',[aUserName],self);
    {$endif}
    FreeAndNil(result);
  end;
end;

procedure TSQLRestServerAuthentication.SessionCreate(Ctxt: TSQLRestServerURIContext;






|







 







|







27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
.....
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
  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}
    SQLite3Log.Add.Log(sllUserAuth,'Deleted session %/% from %/%',
      [User.LogonName,IDCardinal,RemoteIP,ConnectionID],self);
    {$endif}
    if Assigned(OnSessionClosed) then
      OnSessionClosed(self,fSessions.List[aSessionIndex],Ctxt);
    fSessions.Delete(aSessionIndex);
    fStats.ClientDisconnect;
  end;
................................................................................

function TSQLRestServerAuthentication.GetUser(Ctxt: TSQLRestServerURIContext;
  const aUserName: RawUTF8): TSQLAuthUser;
begin
  result := fServer.fSQLAuthUserClass.Create(fServer,'LogonName=?',[aUserName]);
  if result.fID=0 then begin
    {$ifdef WITHLOG}
    SQLite3Log.Add.Log(sllUserAuth,
      'User.LogonName=% not found in AuthUser table',[aUserName],self);
    {$endif}
    FreeAndNil(result);
  end;
end;

procedure TSQLRestServerAuthentication.SessionCreate(Ctxt: TSQLRestServerURIContext;