On 12 Jan 2010, at 03:48, Michael Spiegle wrote:

> I have a module that oftentimes needs to use a subrequest in order to
> finish sending the response.
> 
> If I create the subrequest via ap_sub_req_lookup_uri(), then add a
> "Range" header to sr->headers_in, this appears to work ok if my
> subrequest is destined for mod_proxy.  I believe this is because
> mod_proxy just passes all the headers through, and the backend server is
> actually doing the byterange work for me.

Yep, makes sense.

> If I have the same situation, but the subrequest is being serviced by a
> local file, the byterange filter won't run even if I explicitly add it
> in the chain via ap_add_output_filter().

The subrequest isn't running its own private filter; it's feeding into the 
common filter chain, which sees the headers from the main request.

> I understand that there could be certain situations where I can't rely
> on the byterange filter, but I don't believe I would encounter them in
> my application.  Is there any way to get this to work, or am I doing
> something totally wrong?

Filters and subrequests are a difficult area, and I don't think there's
a "good" (non-hackish) way to do what you want (short of the proxy).
If you were to run a subrequest with its own private filter chain, you
have to figure out exactly where/how it feeds into the "main" request
filters.

I'll be interested if you do come up with a good solution that could
be incorporated into the API for others facing similar issues.

[this response is OTTOMH - I don't think I have anything more to
add than confirmation of what you've found - sorry].

-- 
Nick Kew

Reply via email to