HTTP Responsestream Exception after updating BIZ to Juli Updates

function THttpResponseStream.Seek(const Offset: Int64;
raises

EStreamError.Create('Http response stream cannot change position.');

This occurs using RemoteDB through different operations.
For Example:

  • TDatabaseManager.ValidateDatabase
  • Aurelius.Criteria.Base.TCriteria.ListValues
Sparkle.Http.Engine.THttpResponseStream.Seek(79,???)
System.Classes.TStream.SetPosition(79)
System.ZLib.TZDecompressionStream.Destroy
System.TObject.Free
Sparkle.Http.Engine.THttpResponse.Destroy
Sparkle.WinHttp.Engine.TWinHttpResponse.Destroy
System.TObject.Free
RemoteDB.Client.Database.TRequestPerformer.Destroy
System.TObject.Free
RemoteDB.Client.Database.TRemoteDBDatabase.CheckConfig
RemoteDB.Client.Database.TRemoteDBDatabase.CheckConnect
RemoteDB.Client.Database.TRemoteDBProvider.CheckConnect
RemoteDB.Client.Database.TRemoteDBProvider.Open($45308440)
RemoteDB.Client.Dataset.TBaseXDataset.OpenProvider(0,0)
RemoteDB.Client.Dataset.TBaseXDataset.InternalOpen
Data.DB.TDataSet.DoInternalOpen
Data.DB.TDataSet.OpenCursor(???)
RemoteDB.Client.Dataset.TBaseXDataset.OpenCursor(False)
Data.DB.TDataSet.SetActive(???)
Data.DB.TDataSet.Open
Aurelius.Drivers.RemoteDB.TXDatasetStatementAdapter.ExecuteQuery
Aurelius.Commands.AbstractSqlPerformer.TAbstractSQLPerformer.ExecuteQuery('SELECT A.TENANT As f0_'#$D#$A'FROM TENANTS A'#$D#$A'ORDER BY  A.TENANT Asc',???)
Aurelius.Commands.Selecter.TSelecter.ExecuteSelectSome(???)
Aurelius.Commands.Selecter.TSelecter.SelectBegin(???)
Aurelius.Engine.ObjectManager.TObjectManager.TEngineCursor.CheckSelecter
Aurelius.Engine.ObjectManager.TObjectManager.TEngineCursor.Next
Aurelius.Criteria.Base.TCriteria.FillList($44B65200)
Aurelius.Criteria.Base.TCriteria.List<Aurelius.Criteria.Base.TCriteriaResult>
Aurelius.Criteria.Base.TCriteria.ListValues

I could fix this issue by accepting Offset = Position:

function THttpResponseStream.Seek(const Offset: Int64;
  Origin: TSeekOrigin): Int64;
begin
  if Offset = 0 then
    case Origin of
      soBeginning:
        if FContentSize = 0 then Exit(0);
      soCurrent, soEnd:
        Exit(FContentSize);
    end;
  //>>> begin Fix
  if Offset = Position then
    Exit(Position);
  //<<< end FIX
  raise EStreamError.Create('Http response stream cannot change position.');
end;

Is this a good idea?

Can you please check if this change works:

function THttpResponseStream.Seek(const Offset: Int64;
  Origin: TSeekOrigin): Int64;
begin
  case Origin of
    soBeginning:
      if FContentSize = Offset then Exit(FContentSize);
    soCurrent, soEnd:
      Exit(FContentSize);
  end;
  raise EStreamError.Create('Http response stream cannot change position.');
end;

This change fixed my issue as well

Thanks for the feedback, fix will be released asap.

Your fix works fine for us

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.