httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Manolache <sor...@gmail.com>
Subject Re: POST subrequests via mod_proxy
Date Wed, 13 Jan 2010 10:39:45 GMT
On Wed, Jan 13, 2010 at 11:21, Graham Leggett <minfrin@sharp.fm> wrote:
> On 13 Jan 2010, at 12:07 PM, Sorin Manolache wrote:
>
>> I understand. However, I don't want to make a subrequest with the body
>> of the main request. I want to be able to make a subrequest with a
>> totally new request body.
>>
>> For example:
>>
>> The client sends to my server:
>>
>> POST /server_url
>> (main) request body: body_from_client_to_server
>>
>> My server would make a subrequest to a backend:
>>
>> POST /backend_url
>> subrequest body: body_from_server_to_backend
>>
>> Or even this scenario:
>>
>> Client to my server:
>> GET /server_url
>>
>> My server to a backend:
>>
>> POST /backend_url
>> subrequest body: blabla
>
> In this case, you want to create a simple input filter, which puts your
> intended request body into a brigade, and then passes the brigade
> (containing your body) to whatever is making the request.

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.

Sorin

Mime
View raw message