httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Manolache <>
Subject Re: POST subrequests via mod_proxy
Date Wed, 13 Jan 2010 16:39:44 GMT
On Wed, Jan 13, 2010 at 12:01, Graham Leggett <> wrote:
> 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.

Yes, I am aware of setting r->main to NULL but I think it is too
disruptive. For example, mod_deflate behaves differently if it deals
with a main or a sub-request. Also, some headers are forwarded or not
by mod_proxy depending if the request is a main request or a

So I would really ask the developers of mod_proxy to consider removing
the three lines from the if-block in ap_proxy_http_request.

if (r->main) {
 e = apr_bucket_eos_create(input_brigade->bucket_alloc);
 APR_BRIGADE_INSERT_TAIL(input_brigade, e);
 goto skip_body;

Thank you,

View raw message