httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_include.c
Date Sat, 16 Sep 2000 17:15:05 GMT
rbb@covalent.net writes:

> On 15 Sep 2000 trawick@locus.apache.org wrote:
> 
> > trawick     00/09/15 14:23:46
> > 
> >   Modified:    src/modules/standard mod_include.c
> >   Log:
> >   Handle a tag that appears at the start of a bucket.
> 
> This is incorrect.  A split at the start of a bucket should create a zero
> length bucket and a bucket with the rest of the data.  If splitting a
> bucket at the zero offset returns an error, then we end up with a lot of
> special case code throughout the server.
> 
> >   Get rid of an endless loop (waiting for dptr2 to become NULL instead of
> >   AP_BRIGADE_SENTINEL()).
> 
> This change is also incorrect.  If the find_string does not find the
> starting sequence, then it will return NULL.  With this change, we will
> search for an ending sequence even if we don't have a starting
> sequence.

Here is your original loop:

        if ((tagbuck = find_string(dptr, STARTING_SEQUENCE, AP_BRIGADE_LAST(bb))) != NULL)
{
            dptr2 = tagbuck;
            dptr = tagbuck;
            while (dptr2 && 
                  (endsec = find_string(dptr2, ENDING_SEQUENCE, AP_BRIGADE_LAST(bb))) == NULL)
{
                dptr2 = AP_BUCKET_NEXT(dptr2);
            }
            if (endsec == NULL) {
                /** No ending tag, needs to become an error bucket */
            }

The conditions for your while loop make no sense.  dptr2 will never
become NULL and there is no guarantee that we'll find the ending
sequence in this brigade.

Hmmm... Why is there a loop at all?  find_string() loops through the
brigade so there is no sense in looking further.  The loop needs to go
away...  Either we find ENDING_SEQUENCE in the current brigade or we
don't.

I'm starting to get the hang of this code...  I just need to find a
quiet spot for a while.  (If you are actively working in the code,
let me know because I've got better things to do.  Otherwise, I'll
keep working on it as time allows.)

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message