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

Reply via email to