diff options
author | Dirk-Willem van Gulik <dirkx@apache.org> | 2008-02-09 16:04:57 +0100 |
---|---|---|
committer | Dirk-Willem van Gulik <dirkx@apache.org> | 2008-02-09 16:04:57 +0100 |
commit | 862722ebf45605f8a11c5d1ecbe5ea290d013dd5 (patch) | |
tree | e08de63647c97e3206382096ae6e30dd0374ea18 /modules/mappers/mod_negotiation.c | |
parent | oops, forgot to add these. As part of PR 41823 (diff) | |
download | apache2-862722ebf45605f8a11c5d1ecbe5ea290d013dd5.tar.xz apache2-862722ebf45605f8a11c5d1ecbe5ea290d013dd5.zip |
Sub-requests are created and used with two purposes; sometimes
simply to 'see' what a request would do; as to fill out an SSI,
validate access or similar - and is then discarded. And sometimes
as the precursor to becoming the actual request; e.g. when mod_dir
checks if an /index.html can be served for a '/'.
In the latter case it is important to preserve the output filters
'for real'; whereas in the first case they have to be reset to
purely the minimal proto filters (if at all). This patch instates
the output filters in 3 cases where sub-requests are/may in fact
be used as the real request later on.
This is a relatively risky change (which should not be back-ported
without further discussion) and may break caches in combination
with internal redirects/vary/negotiation in subtle ways.
See the thread starting at [1] and in particular the general
concerns of rpluem at [2] with respect to sub requests
and (fast_)internal redirects possibly needing a more
thorough overhaul.
1: http://mail-archives.apache.org/mod_mbox/httpd-dev/200802.mbox/ajax/%3c335D1A4B-25E2-4FF1-8CDF-5010A7FBD293@webweaving.org%3e
2: http://mail-archives.apache.org/mod_mbox/httpd-dev/200802.mbox/%3c47ACE1D4.4060702@apache.org%3e
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@620133 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_negotiation.c')
-rw-r--r-- | modules/mappers/mod_negotiation.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 3a89dc3f9c..c34fd8a952 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -1165,8 +1165,10 @@ static int read_types_multi(negotiation_state *neg) /* Double check, we still don't multi-resolve non-ordinary files */ - if (sub_req->finfo.filetype != APR_REG) + if (sub_req->finfo.filetype != APR_REG) { + /* XXX sub req not destroyed -- may be a bug/unintentional ? */ continue; + } /* If it has a handler, we'll pretend it's a CGI script, * since that's a good indication of the sort of thing it @@ -2712,7 +2714,7 @@ static int setup_choice_response(request_rec *r, negotiation_state *neg, if (!variant->sub_req) { int status; - sub_req = ap_sub_req_lookup_file(variant->file_name, r, NULL); + sub_req = ap_sub_req_lookup_file(variant->file_name, r, r->output_filters); status = sub_req->status; if (status != HTTP_OK && @@ -3122,7 +3124,7 @@ static int handle_multi(request_rec *r) * a sub_req structure yet. Get one now. */ - sub_req = ap_sub_req_lookup_file(best->file_name, r, NULL); + sub_req = ap_sub_req_lookup_file(best->file_name, r, r->output_filters); if (sub_req->status != HTTP_OK) { res = sub_req->status; ap_destroy_sub_req(sub_req); |