httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: Apache Buckets and Brigade
Date Wed, 01 May 2013 15:29:27 GMT

On 1 May 2013, at 14:41, Sorin Manolache wrote:

> In my experience the buckets that I've seen have about 8 kilobytes. So you will not consume
too much memory if you "flatten" the bucket brigade into one buffer and then perform the replacement
in the buffer. (see apr_brigade_flatten). However, you have to provide for the case in which
oldString is split between two brigades.

Don't rely on that.  The size of buckets and brigades depends entirely
on what comes before your filter.  8k chunks are common from some
sources (e.g. mod_proxy), but even there another filter could change
all that - e.g. mod_deflate if the data arrive compressed.

Bottom line: don't make assumptions, as there are no guarantees.

You can of course look at existing filters that do similar things
to yours.  Or even read about it in my book :-)

Nick Kew
View raw message