httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Park <ronald.p...@cnet.com>
Subject RE: Two mod_include problems
Date Thu, 10 Jul 2003 15:42:29 GMT
Originally, we resolved this first problem without
a complete understanding of how buckets and brigades
work, and my explaination was taken from a previous
attempt to write up just that problem... then we ran
into the second problem and learned a whole lot about
brigades.  When I wrote up this message, I had a feeling
the first problem was also brigade related too 1but stuck
with my original writeup.  Thanks for clarifying.

I kinda thought that it should pass 'buf' as the arg
rather than 'c' but I was afraid there was some reason
for having chosen 'c' in the first place. :)

We're trying to come up with nice simple test cases to
show the problems (all ours involve a proprietary module
and mod_proxy but they should be recreatable with some
carefully crafted file sizes).

Thanks for investigating!

Ron

> -----Original Message-----
> From: André Malo [mailto:nd@perlig.de] 
> Sent: Wednesday, July 09, 2003 6:54 PM
> To: dev@httpd.apache.org
> Subject: Re: Two mod_include problems
> 
> 
> * Ron Park wrote:
> 
> > At line 438 of mod_include, we see the code is set up to handle
> > this 'left over partial match' and it increments the temporary
> > buffer pointer, c, by 2 as it walks past the '--' at the start
> > of this bucket.  So it (as far as I could determine) adds the
> > left over '<!' to this bucket
> 
> That's a misreading. It doesn't prepend the bucket, it 
> prepends the brigade,
> leaving the bucket untouched. That way...
> 
> > and continues on, calling the
> > quick scanner function, bndm(), passing in the recently updated
> > parameter 'c'.
> 
> ... here comes the obvious failure. c is the wrong pointer. 
> It must be buf
> (i.e. start of the bucket content). Then pos should be 
> correct. The following
> solves this problem finally (for me):
> 
> Index: modules/filters/mod_include.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
> retrieving revision 1.233
> diff -u -r1.233 mod_include.c
> --- modules/filters/mod_include.c       3 Feb 2003 17:53:01 
> -0000       1.233
> +++ modules/filters/mod_include.c       9 Jul 2003 22:43:46 -0000
> @@ -477,7 +477,7 @@
> 
>          if (len)
>          {
> -            pos = bndm(str, slen, c, len, ctx->start_seq_pat);
> +            pos = bndm(str, slen, buf, len, ctx->start_seq_pat);
>              if (pos != len)
>              {
>                  ctx->head_start_bucket = dptr;
> 
> (Note that is even more logically, since len is also untouched).
> 
> digging into the second problem now...
> 
> Thanks for your deep investigation!
> 
> nd
> 

Mime
View raw message