Re: New zlib patch (supports gzip encoding)

Mark Atkinson <[email protected]> Fri, 29 Apr 2005 10:15:00 -0700 (PDT)
Newsgroups gmane.comp.web.wget.patches
Message-ID <20050429090352.T18642@localhost>
On Thu, 28 Apr 2005, Hrvoje Niksic wrote:
> Mark Atkinson <[email protected]> writes:
>> - added skipping a body if you encounter a body in reponse to a HEAD
>>   request.
>
> That change will never work.  The HEAD request is *supposed* to
> include a Content-Length indicating how large the body would have been
> if you used GET with the same resource.  Calling skip_short_body will
> simply cause Wget to hang, waiting for a body that will never appear.
>
> In other words, there is absolutely no way to distinguish conforming
> peers from non-conforming ones.

Yes, you're absolutely correct.   This will actually cause wget to assert 
on Apache servers (since contlen will be -1).  I had only added this to 
work around a server that would return a body with the correct content 
length when HEAD would actually return a error (404, etc..).

This was causing that error html to be 'pre-pended' on the next page 
request -- corrupting my retrieval, because the CLOSE_FINISH() macro takes 
no action with keep_alive enabled.

--
Mark Atkinson
(!wired)?(coffee++):(wired);