#1 2017-08-30 08:47:54

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Invalid Timestamp

I'm having a problem with invalid timestamps when making two requests in quick succession after logging in. The first request succeeds but the second one fails.

In the logs I've got: Invalid TimeStamp: expected >=-8, got 142

The problem seems to be in line 51786 of mormot.pas when result.fLastTimeStamp is less than fTimeStampCoherencyTicks, I assume causing an overflow:

if HexDisplayToCardinal(PTimeStamp,aTimeStamp) and
     (fNoTimeStampCoherencyCheck or (result.fLastTimeStamp=0) or
      (aTimeStamp>=result.fLastTimeStamp-fTimeStampCoherencyTicks)) then begin

could using abs() could be a solution?:

  (aTimeStamp>=abs(result.fLastTimeStamp-fTimeStampCoherencyTicks))) then begin

Also in line 51803 it's failing to log the timestamp value and looks like it should be:

Ctxt.Log.Log(sllUserAuth,'Invalid TimeStamp: expected >=%, got %',
      [result.fLastTimeStamp-fTimeStampCoherencyTicks,Int64(aTimeStamp)],self);  //<<< added Int64(aTimeStamp)

Offline

#2 2017-08-30 09:57:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,131
Website

Re: Invalid Timestamp

I don't think abs() would be a solution.

Please try https://synopse.info/fossil/info/d416ac5665

Thanks a lot for the report!

Offline

#3 2017-08-30 11:39:27

esmondb
Member
From: London
Registered: 2010-07-20
Posts: 299

Re: Invalid Timestamp

Great, thanks for the quick response!

Offline

Board footer

Powered by FluxBB