>  Because gz compression use a DLL, I would like to have it turned 
> off by default at compile time. That is use a conditional compilation 
> switch "USE_HTTP_CLI_GZ" to allow use of the DLL. So all new 
> properties would always be compiled in, but as soon as gz feature
> is requested at 
> runtime, an exception is raised telling the developper to use the 
> symbol. When the symbol is defined, gz will work as expected.

I already have applications supporting GZIP, it's not very complicated 
and does not need any new properties.  Currently I'm using a commercial 
zlib function, but I used DelphiGzip in the past.  

But most important, any changes must be fully backward compatible, I 
don't want my application raising an exception when a gzip page 
arrives, since I'm already handling it. 

Angus


HeaderData
if Field = 'content-encoding' then tencode [item] := Data ;

RequestDone
// see if need to uncompress HTML page
if Lowercase (tencode [item]) = 'gzip' then
begin
  // use VclZip stream version
   TempStream := TMemoryStream.Create ;
   TempStream.LoadFromStream (tconstream [item]) ;
   TMemoryStream (tconstream [item]).Clear ;
   VCLUnZip.ZLibDecompressStream (TempStream,
                           TMemoryStream (tconstream [item]), true) ;
   TempStream.Free ;
end ;

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to