diff options
author | Graham Leggett <minfrin@apache.org> | 2011-02-13 00:21:18 +0100 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2011-02-13 00:21:18 +0100 |
commit | b591028272e05e03e6a0f575829afde0cf84ae01 (patch) | |
tree | 5e032aee2cdc5eb9380c1cfde1a8e97538556f73 /modules/cache/mod_cache.c | |
parent | Use ap_state_query() to fix many modules that were not correctly initializing (diff) | |
download | apache2-b591028272e05e03e6a0f575829afde0cf84ae01.tar.xz apache2-b591028272e05e03e6a0f575829afde0cf84ae01.zip |
mod_cache: Make sure that the moving of the CACHE filter to another
point within a subrequest is limited to affecting filters in that
subrequest only.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070161 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/cache/mod_cache.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 1faa2e745e..f02922d563 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -298,11 +298,13 @@ static int cache_quick_handler(request_rec *r, int lookup) * second filter, and return true. If the second filter is not present at * all, the first filter is removed, and false is returned. If neither * filter is present, false is returned and this function does nothing. + * If a stop filter is specified, processing will stop once this filter is + * reached. */ static int cache_replace_filter(ap_filter_t *next, ap_filter_rec_t *from, - ap_filter_rec_t *to) { + ap_filter_rec_t *to, ap_filter_rec_t *stop) { ap_filter_t *ffrom = NULL, *fto = NULL; - while (next) { + while (next && next->frec != stop) { if (next->frec == from && !next->ctx) { ffrom = next; } @@ -439,7 +441,8 @@ static int cache_handler(request_rec *r) * filter will remain in place. */ if (cache_replace_filter(r->output_filters, - cache_filter_handle, cache_save_handle)) { + cache_filter_handle, cache_save_handle, + ap_get_input_filter_handle("SUBREQ_CORE"))) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, "Replacing CACHE with CACHE_SAVE " "filter for %s", r->uri); @@ -513,7 +516,8 @@ static int cache_handler(request_rec *r) * lie *after* the original location of the CACHE filter will remain in * place. */ - if (cache_replace_filter(r->output_filters, cache_filter_handle, cache_out_handle)) { + if (cache_replace_filter(r->output_filters, cache_filter_handle, + cache_out_handle, ap_get_input_filter_handle("SUBREQ_CORE"))) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, "Replacing CACHE with CACHE_OUT filter for %s", r->uri); |