httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject is it possible to mark buckets to be copied only when to be set-aside?
Date Wed, 19 May 2004 05:09:30 GMT
We have the following situation in mod_perl 2 land: we use the same buffer to 
allocate data in buckets which are passed to the filters. That bucket is 
created once per request. It works perfectly fine and effective most of the 
time (we copy from user's program perl space into the re-usable buffer, but no 
extra allocation happens). But just now one user has reported that it breaks 
mod_xslt filter, which sets aside the buckets sent from the modperl handler, 
and then uses them after seeing EOS. By that time the data in all but last 
bucket is corrupted. Obviously the straightforward solution is to allocate a 
new buffer for each bucket that mod_perl sends to the filter chain. But this 
is a huge waste for most users, which don't use this particular kind of output 
filters that setaside buckets.

My question is: Is it possible to mark the bucket's data as volatile or 
something, so if a downstream filter wants to set them aside it will have to 
do the copying?

At the moment the bucket is created as:
     bucket = apr_bucket_transient_create(buf, len, ba);
and buf is static for the length of the request.

Thank you.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message