Re: [xml] PATCH: gzip decoding support for remote HTTP resources

On Thu, Dec 15, 2005 at 03:51:38AM +0000, Gary Coady wrote:
Hi there,
attached is a sample patch which might be useful for retrieving
compressed resources over HTTP. It sends the "Accept-Encoding" header,
and then passes the response through zlib if the "Content-Encoding"
response header is appropriately set.

  Sounds cool, but I'm a bit worried by the case where the return is not
compressed, in xmlNanoHTTPRead() you will pass
  if (ctxt->usesGzip == 1 && ctxt->strm == NULL)
because ctxt->usesGzip should be 0, but  ctxt->strm will be NULL and
will be dereferenced on the next line. It seems to me that this whole
chunk of code need to be garded by
   if (ctxt->usesGzip) {
and normal existent code should be run in the default case. Otherwise the
patch looks fine. Can you confirm my analysis ?

However, maybe it needs a flag somewhere to disable this behaviour
unless it is required?

  I think it's a common expected behaviour at this point in the WWW stack,
I don't really see why using compressed disk resources would be allowed by
not compressed http resources (if none is allowed that can be configure
with --without-zlib


Daniel Veillard      | Red Hat
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]