We are having an issue when uploading a file to TROIpSuperHTTPServer when the file is over 1MB.
This is under Delphi XE and the latest version of RO (although it happens in previous versions.
MaxPackageSize property of the SuperServer (TROIpSuperHTTPServer) is set to 20971520.
When sending aan image (size: 1051 KB) a stack overflow error is happening (Exception class EStackOverflow with message ‘Stack overflow’.) in then HeaderValid function of TBinHeader which is called from IsValidSuperHttpRequest function of TROBaseSuperHTTPServer, which is called from IncomingData function of TROBaseSuperHTTPServer
can you create a simple testcase that reproducing this problem, pls?
this is system exception:
EStackOverflow = class(EExternal)
end deprecated;
our components don’t raise EStackOverflow exception at all, so it can be a corner case.
as a workaround, update uROBaseSuperHttpServer.pas as
function TROBaseSuperHTTPServer.IsValidSuperHttpRequest(
aRequest: TDynamicByteArray): Boolean;
var
k: PByteArray;
begin
Result := Length(aRequest) > 0;
if Result then begin
k := PByteArray(@aRequest[0]);
if (Length(aRequest) < 16 + 1) or // schttp message size always > 17
TROMessage.HasEnvelope(k^) or // message envelope header isn't found
TBinHeader.HeaderValid(k^) then // bin message header isn't found
Result := False
else
Result := aRequest[16] in [ShHello..ShAsyncWait];
end;
end;