httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: cvs commit: apache-2.0/src/main http_core.c http_protocol.c
Date Mon, 02 Oct 2000 23:45:48 GMT
On Mon, 2 Oct 2000, William A. Rowe, Jr. wrote:

> > From: []
> > Sent: Monday, October 02, 2000 6:13 PM
> > 
> > Being a static function doesn't mean it must be placed by the core
> > filter.  As long as the function can be named at some point, it can be
> > added by anybody.  This is why I want this as a part of the core
> > filter.  Doing the buffering in multiple places, or anyplace 
> > other than
> > the core filter is a bit bogus.
> Anything but...
> silly example, mod_random.  Ok, you want to maximize the random results
> ... you need to place the buffer filter before mod_random, after
> mod_autoindex.  Otherwise we end up with single lines in sequence, not
> randomized, since the mod_random fitler is only given one line each
> iteration.
> I entirely agree with Greg that we do -not- want every author to reinvent
> filtering.

I disagree completely.  If mod_random is written to re-arrange buckets,
then it is broken.  It is completely impossible to determine how a handler
will arrange the content in a brigade.  I entirely expect to re-write
mod_autoindex to use a single brigade to pass data down, at far fewer
buckets than it currently uses.  The only reason I haven't done so already
is that I have had bigger fish to fry and very little time.

Filters can not be written to expect data in any particular
format.  Filters have to accept buckets of data, and they have to work
with the data, not the buckets.  Otherwise the result of those filters
will be unpredictable.

There are only two reasons IMHO to buffer above the core filter:

1)  The ap_r* functions should do some buffering, so that we make as few
trips down the stack as possible.  This is an optimization and should wait
to be done.  I expect there will need to be some logic to ensure that we
don't try to buffer too much or at inappropriate times.

2)  The filter requires it.  This is something like our favorite
mod_content_length example, where the filter requires that it has all of
the data before it passes down the stack.

Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message