httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: Mod_include design
Date Thu, 02 Nov 2000 19:50:52 GMT
On Thu, Nov 02, 2000 at 12:44:15PM -0800, wrote:
> Greg's comment that we might as well copy as we find the tag, I don't
> agree with either.  Picture a brigade that looks like:
> "<" -> "!" -> "-" -> "foobar"
> This is an invalid tag.  If we copy as we find things, then we will copy
> things into the buffer that isn't really a tag, and if we use the presence
> of data in the buffer to siginify a tag, then we have a problem.
> If we copy the tag once we have found the full tag, then we can actually
> allocate a buffer of the correct size for the tag that we have.

You are going to do one of two things as you look for the tag:

1) set aside a brigade
2) copy into a buffer

Given that (1) might do a copy, and that you will eventually do (2), then
you may as well do it as you go.

And, oh, gee, heavens-to-betsy, we find that the tag is invalid. Well, gosh
darnit. We went and copied four bytes into a buffer and now we need to send
that all down to the next filter.

Yah, right. Like we need to be worried about those four bytes.

Copy the darn thing until you find your tag. It keeps it clean and simple,
and there is next to zero performance degradation. I don't understand the
rationale for a bunch of complexity to avoid copying four bytes.


Greg Stein,

View raw message