httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [PATCH] buckets take 2
Date Thu, 18 Jan 2001 04:00:42 GMT

> > Well, I hate this, but at least it moves us forward.  All this does, is
> > remove the change from ap_r* to ap_brigade_*, and it wraps the
> > ap_brigade_* functions in ap_r*.  Existing modules will still work, and we
> > stop creating tons of little buckets.
> 1) doesn't deal with network pressure. mod_autoindex will generate the whole
>    response in memory before delivering a single byte.

Actually I have a fix in mind for this, but I wanted to begin to implement
the idea before implementing the whole thing.  Expect a new patch within a
few hours.

> 2) doesn't allow mixing of ap_r* and ap_pass_brigade()
>    [ can easily happen with utility functions ]

I don't see this as a real problem.  I have spoken to Doug M, and as he
put it, the ap_r* API is basically staying as a compatability API.  If you
want to use the brigade API, then switch to it.  I am not at all
interested in allowing people to mix the API's, because it removes a lot
of features.

> 3) users must call standardize() on a brigade before they can use it, but
>    the determination for doing so is based on how it was created (which
>    could be elsewhere in the code, relative to the consumer of the brigade).
>    essentially, the brigade's integrity is easily corrupted

But, standardize() is a safe function to call.  It is perfectly valid to
call that function at any time, and nothing happens to the brigade unless
it is supposed to.  I do not mind asking people to work a bit harder if
they want to mix API's a bit.  Also, we can easily add more functions,
such as ap_brigade_sendfile, which basically does the checking and then
appends a file bucket to the end of the brigade.  I was more interested in
getting the basic stuff working before going on to the more complex stuff.

> A long while back, you had an idea for brigade functions that would append
> into the last bucket if space was available. I think your original idea
> would work much better here. A quick recap/notes:
> *) ap_brigade_puts() [and brethren] would check if the last bucket is a HEAP
>    or POOL bucket, and call ap_bucket_(heap|pool)_puts().
> *) standardize no longer needed since a bucket already exists
> *) allows mixing ap_brigade_puts() and insertion of other buckets
> Using the above mechanism would be good for item (3) above, and could be
> good for appending a small brigade (e.g. a single transient bucket) into
> another brigade.

But it doesn't work in general, because it easily allows for brigades like
the following:

5 byte heap -> 10 byte transient -> 5 byte heap -> 10 byte transient

Also, to really make the idea work, the HEAP and POOL buckets were always
4K buckets so we wasted a lot of memory.


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

View raw message