Hi,
The previous post was atomatically closed with out a solution.
I´'m using the following code to decompress deflate cliente request, If I use HttpSys Server it works ok, using TIndySparkleHTTPServer I get ACCESS_VIOLATION exception on "TStream.SetPosition".
Any hint what am I doing wrong?
Thanks in advance,
Omar Zelaya
if Context.Request.Headers.Get('content-encoding') = 'deflate' then
begin
TempStream := TMemoryStream.Create;
try
repeat
BytesRead := Context.Request.ContentStream.Read(Buffer[0], BufSize);
TempStream.Write(Buffer[0], BytesRead);
until BytesRead <> BufSize;
TempStream.Position := 0;
Context.Request.ContentStream.Free;
Context.Request.ContentStream := TZDecompressionStream.Create(TempStream, 15, True);
Context.Request.Headers.SetValue('content-length', '-1');
except
TempStream.Free;
raise;
end;
end