[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [neon] [PATCH] Fix neon inflate bug

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-06-08 19:06:17 CEST

On Sat, Jun 08, 2002 at 01:48:05PM +0100, Joe Orton wrote:
> On Thu, Jun 06, 2002 at 11:20:29AM -0700, Justin Erenkrantz wrote:
> > With this patch to neon and HEAD of httpd-2.0 and mod_deflate turned
> > on, I can check out my own website under SVN control with gzip
> > compression.
> >
> > So, I think most of the bugs are ironed out now. =)
> >
> > * src/ne_compress.c (do_inflate): If we have nothing left to inflate,
> > do not try to re-execute the loop and inflate again. We would get a
> > Z_BUF_ERROR in this case.
> Hmmm, I'm not sure it's quite this simple... this only works because
> avail_in is guaranteed to be > 0 at the end of the stream because of the
> unconsumed gzip trailer.

Neon would try to inflate when avail_in was 0. If there is nothing
left to inflate, why call it again? How is that valid? We're not
yet guaranteed to be at the end of the stream because we're just
inflating chunks.

> When does this Z_BUF_ERROR happen - can you send me a document to
> reproduce it? zlib.h says that inflate() does either or both of consume
> input/provide output, not that it needs to consume input every time it
> is called; in my tests inflate() gets called when avail_in is zero
> without any problems.

I was checking out this file from my SVN repository:


Well, whenever avail_in was zero and neon called inflate() with
zlib-1.1.4, it caused Z_BUF_ERROR. And, as stated in the zlib
FAQ (question #6):

    6. deflate() or inflate() returns Z_BUF_ERROR

        Before making the call, make sure that avail_in and avail_out are
        not zero. When setting the parameter flush equal to Z_FINISH,
        also make sure that avail_out is big enough to allow processing
        all pending input.

I know Ben Collins should be trying mod_deflate/neon with SVN, so he
may also be able to reproduce this case. -- justin

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 8 19:07:13 2002

This is an archived mail posted to the Subversion Dev mailing list.