Hello!

You are right! Double copy is a bad idea and mod_xslt should be fixed.
I can't provide path for mod_xslt now because it's already hacked for my
needs. May be later. The author of mod_xslt didn't answer at all.

Best regards,
/grig

-----Original Message-----
From: Stas Bekman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 19, 2004 10:28 AM
Cc: Gregory Burmistrov; [EMAIL PROTECTED]
Subject: Re: Bug: mod_perl and mod_xslt as output filter

Stas Bekman wrote:
> Gregory Burmistrov wrote:
> 
>> Hello!
>>
>> I've had a challenge with mod_perl and mod_xslt under Apache2, the
>> problem is:
>>
>> mod_xslt collects buckets from mod_perl for further processing. When
>> mod_xslt got EOS bucket processing occurs, but some data in buckets
>> appear to be corrupted.
>>
>> After few hours with various server configurations, gdb and other fun
>> stuff, I've found a clue. At least it works for me.
> 
> 
> I see what you mean Gregory. But that solution doesn't make me happy. 
> Most of the time you won't need to do that, and forcing a double copy
of 
> data on each print call is not an efficient thing to do. Let me ask 
> httpd-dev whether there is a way to mark buckets as something that has

> to be copied on if set-aside.

This time the answer came back quicky, quoting Bill:

   It's a bug in mod_xslt, if that module trys to set aside a transient
bucket.

http://marc.theaimsgroup.com/?t=108494355000002&r=1&w=2

So please tell the author of mod_xslt that it needs to check whether the

bucket type is transient and if so it has to do the copying on itself. 
Unfortunately I can't point you to the httpd filter docs, since I'm not
aware 
of their existence. Though apr_bucket.h has this:

/**
  * The TRANSIENT bucket type.  This bucket represents a data allocated
off
  * the stack.  When the setaside function is called, this data is
copied on
  * to the heap
  */
APU_DECLARE_DATA extern const apr_bucket_type_t
apr_bucket_type_transient;

So if mod_xslt uses a proper function like: apr_bucket_setaside to keep
the 
buckets, supposedly it should handle the copying on itself,
transparently to 
the filter writer.

I'll document that in our source code and have a note for modperl filter
writers.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to