cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with CONTENT-ENCODING

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 13 Dec 2005 10:28:09 -0800

On Tue, Dec 13, 2005 at 11:25:40AM +0200, Dobromir Velev wrote:
> That's why added nread in the if clause on line 152. The only possible problem
> here is that z will not be inited before any bytes were received but I
> thought that was OK. I will send another patch with more comments if needed

That's not the only problem--if nread==0 then the code skips over the
zlib init call and dives right into inflate_stream() and then inflate(),
passing in an uninitialized z_stream pointer!

> - I just saw that zlib is using a similar test in inflate.c to check the
> headers and that was were the IIS deflate encoding was failing.
>
> >
> The problem is that I don't have a lot of different setups to test with so I
> tried with several servers on the Internet. Most of the failing servers
> ignore the order in the Accept-Encoding header and when a
> "Accept-Encoding: deflate, gzip" request is sent they will ignore deflate and
> use gzip instead. The problem appears only when a "Accept-Encoding: deflate"
> requeste header is sent. Here are two sample sessions that fail

I was hoping the Server: line would provide the answer; the first one isn't
much help, but the second is showing Apache 2.0.40. That's one server I
would expect to get it right, especially since Apache 1.3 did :-)

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2005-12-13