httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r538868 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/cache/mod_cache.c
Date Thu, 17 May 2007 10:55:16 GMT
Author: rpluem
Date: Thu May 17 03:55:15 2007
New Revision: 538868

URL: http://svn.apache.org/viewvc?view=rev&rev=538868
Log:
Merge r425787 from trunk:

* Remove all filters that are before the cache_out filter. This ensures
  that we kick off the filter stack with our cache_out filter being the
  first in the chain. This make sense because we want to restore things
  in the same manner as we saved them.
  There may be filters before our cache_out filter, because

  1. We call ap_set_content_type during cache_select. This causes
     Content-Type specific filters to be added.
  2. We call the insert_filter hook. This causes filters e.g. like
     the ones set with SetOutputFilter to be added.

PR: 40090

Submitted by: rpluem
Reviewed by: rpluem, wrowe, jerenkrantz

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?view=diff&rev=538868&r1=538867&r2=538868
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Thu May 17 03:55:15 2007
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.5
 
+  *) mod_cache: While serving a cached entity ensure that filters that have
+     been applied to this cached entity before saving it to the cache are not
+     applied again. PR 40090. [Ruediger Pluem]
+
   *) mod_cache: Correctly cache objects whose URL query string has been
      modified by mod_rewrite. PR 40805. [Ruediger Pluem]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?view=diff&rev=538868&r1=538867&r2=538868
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Thu May 17 03:55:15 2007
@@ -105,16 +105,6 @@
      http://svn.apache.org/viewvc?view=rev&rev=520733
      +1: wrowe, rpluem, niq
 
-   * mod_cache: While serving a cached entity ensure that filters that have
-     been applied to this cached entity before saving it to the cache are not
-     applied again.
-        PR: 40090
-     Trunk version of patch:
-       http://svn.apache.org/viewvc?rev=425787&view=rev
-     2.2.x version of patch:
-       Trunk version works
-     +1: rpluem, wrowe, jerenkrantz
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 
     * ApacheMonitor: Fix Windows Vista detection.

Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c?view=diff&rev=538868&r1=538867&r2=538868
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c Thu May 17 03:55:15 2007
@@ -56,6 +56,8 @@
     cache_request_rec *cache;
     cache_server_conf *conf;
     apr_bucket_brigade *out;
+    ap_filter_t *next;
+    ap_filter_rec_t *cache_out_handle;
 
     /* Delay initialization until we know we are handling a GET */
     if (r->method_number != M_GET) {
@@ -213,12 +215,29 @@
      * or not.
      */
     if (r->main) {
-        ap_add_output_filter_handle(cache_out_subreq_filter_handle, NULL,
-                                    r, r->connection);
+        cache_out_handle = cache_out_subreq_filter_handle;
     }
     else {
-        ap_add_output_filter_handle(cache_out_filter_handle, NULL,
-                                    r, r->connection);
+        cache_out_handle = cache_out_filter_handle;
+    }
+    ap_add_output_filter_handle(cache_out_handle, NULL, r, r->connection);
+
+    /*
+     * Remove all filters that are before the cache_out filter. This ensures
+     * that we kick off the filter stack with our cache_out filter being the
+     * first in the chain. This make sense because we want to restore things
+     * in the same manner as we saved them.
+     * There may be filters before our cache_out filter, because
+     *
+     * 1. We call ap_set_content_type during cache_select. This causes
+     *    Content-Type specific filters to be added.
+     * 2. We call the insert_filter hook. This causes filters e.g. like
+     *    the ones set with SetOutputFilter to be added.
+     */
+    next = r->output_filters;
+    while (next && (next->frec != cache_out_handle)) {
+        ap_remove_output_filter(next);
+        next = next->next;
     }
 
     /* kick off the filter stack */



Mime
View raw message