You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@TAMU.Edu> on 2001/05/08 20:47:06 UTC

Re: capturing subrequest output (have things changed)

"Anand Raman" <ar...@indiainfo.com> wrote:
>hi guys
>I just started off using modperl so excuse me if this has been answered.
>
>Is there a way to capture output from a subrequest.. rather than
>allowing the subrequest to directly output the response to the client
>browser. 
>
>I need to be able to parse the output of the subrequest before
>outputting it to the browser.

Apache 1.x does not support this -- stdout is tied to the socket, iirc.  If 
you are into heavy wizardry, you might try redirecting the stdout file 
descriptor (fd 0) before the subrequest and restore it afterwards.  Note that 
this requires more than tieing STDOUT to something else and is likely to be OS 
dependent to some degree.

Apache 2.x has support for I/O layering which would (hopefully) provide for 
this.
-- 
James Smith <JG...@TAMU.Edu>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix