httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <>
Subject Re: mod_include supporting POST subrequests
Date Wed, 01 Apr 2009 18:39:49 GMT
On Wed 01 Apr 2009, Graham Leggett wrote:
> > Is there a chance for the patch to make it into 2.3++? If yes I'll
> > merge it with the KEPT_BODY stuff.
> Having two separate mechanisms to solve the same problem is not
> ideal. In addition, creating a solution that only works in one place
> (mod_include), is less ideal still.
> It should be relatively straightforward to amend the KEEP_BODY and
> KEPT_BODY filters so that, by default, the first attempt to read the
> body is passed through, and the second and subsequent attempts to
> read the body return an empty brigade.
> This will give you the behaviour you are looking for, and it will
> work anywhere within the server, not just in mod_include.

That is what I thought to do. If KeptBodySize is 0 the body is passed to 
the first (sub)request that is reading it. All subsequent subrequests 
will see an empty stream. If KeptBodySize is >0 the first (sub)request 
reads the whole body and the KEEP_BODY_FILTER saves as much as is 
configured. Subsequent subrequests are passed this kept body.

I also thought of writing the body to temporary files if configured. So 
it's possible to preserve larger body without much headache about 
memory consumption. Plus, I think it would be a nice feature to be able 

  <!--#include method="post" body="a=b;c=d" virtual="..." -->

and perhaps also to include an encoding="multipart/form-data", would it 

BTW, the current patch is not only for mod_include. It should work 
(although not tested) for other filters/handlers as well as long as the 
main request sets the "subreq-pass-request-body" note to prevent the 
header table to be overwritten for the subrequest. This more or less 
resembles what r->kept_body does in 2.3. Alternatively the caller could 
overwrite the header table after creating the subreq but before running 
it and set the original CL and TE headers.

But to restate my question, can I take your reply as "yes, go ahead, it 
would be nice to have that feature in apache httpd"?


Need professional mod_perl support?
Just hire me:

View raw message