You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Dorian Taylor <do...@foobarsystems.com> on 2004/08/27 02:29:58 UTC
[mp2] recirculating (sub)?request output
suppose i wanted to run a subrequest, but instead of outputting the
body (or headers, or anything) of that request down the wire, i
wanted to snag it for processing in another handler. i tried writing
a filter that gathered the content and stuck it in $f->r->prev->notes,
but it still flushes the headers of the main request. what would
be the most appropriate way to go about doing this kind of thing?
cheers
dorian
--
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
Re: [mp2] recirculating (sub)?request output
Posted by Stas Bekman <st...@stason.org>.
Dorian Taylor wrote:
> suppose i wanted to run a subrequest, but instead of outputting the
> body (or headers, or anything) of that request down the wire, i
> wanted to snag it for processing in another handler. i tried writing
> a filter that gathered the content and stuck it in $f->r->prev->notes,
> but it still flushes the headers of the main request. what would
> be the most appropriate way to go about doing this kind of thing?
The flush that causes headers sent must be there in order to keep things
proper.
I'm not sure if playing with $r->assbackwards(1) will help.
http://perl.apache.org/docs/2.0/api/Apache/RequestRec.html#C_assbackwards_
But if you write an output connection filter than you can certainly do
what you plan (you don't even need to run a sub-request).
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_Output_Filters
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org 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