httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <>
Subject Re: POST subrequests via mod_proxy
Date Wed, 13 Jan 2010 11:01:10 GMT
On 13 Jan 2010, at 12:39 PM, Sorin Manolache wrote:

> Exactly. I thought of the same thing. However, if this "whatever" is a
> ap_run_sub_req and the requests passes through mod_proxy, mod_proxy
> does not include the request body for subrequests.
> ap_proxy_http_request in mod_proxy_http.c contains
> if (r->main) {
>  ...
>  e = apr_bucket_eos_create(input_brigade->bucket_alloc);
>  APR_BRIGADE_INSERT_TAIL(input_brigade, e);
>  goto skip_body;
> }
> My suggestion was to remove this code from mod_proxy_http.c.

One option you can use is to set r->main to NULL on the subrequest.  
This causes the subrequest to be treated as a main request, which  
means an attempt will be made to read the request body. You need to  
make sure your input filter is in place to provide the request body  
before you do this, and that no attempt is made to read from the  
connection to the client.

If you want to read the output of the subrequest and not send it to  
the client, add an output filter that captures the output without  
passing it down the filter stack. You can then do with the response  
what you will, and continue with the real main request when you are  


View raw message