httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r190033 - /httpd/httpd/trunk/modules/cache/mod_cache.c
Date Fri, 10 Jun 2005 23:02:26 GMT
Author: pquerna
Date: Fri Jun 10 16:02:26 2005
New Revision: 190033

URL: http://svn.apache.org/viewcvs?rev=190033&view=rev
Log:
* cache_save_filter: 
    *) Remove the first set of Validation code.  Use the main if structure to check for both
'Vary: *' and 'Cache-Control: no-store'.
    *) Add logging of failures for a provider's store_body function.

Modified:
    httpd/httpd/trunk/modules/cache/mod_cache.c

Modified: httpd/httpd/trunk/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/cache/mod_cache.c?rev=190033&r1=190032&r2=190033&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache.c Fri Jun 10 16:02:26 2005
@@ -236,7 +236,7 @@
     cache_request_rec *cache;
     cache_server_conf *conf;
     char *url = r->unparsed_uri;
-    const char *cc_in, *cc_out, *cl, *vary_out;
+    const char *cc_out, *cl;
     const char *exps, *lastmods, *dates, *etag;
     apr_time_t exp, date, lastmod, now;
     apr_off_t size;
@@ -247,19 +247,6 @@
     conf = (cache_server_conf *) ap_get_module_config(r->server->module_config,
                                                       &cache_module);
 
-    /* If the request has Cache-Control: no-store from RFC 2616, don't store
-     * unless CacheStoreNoStore is active.
-     */
-    cc_in = apr_table_get(r->headers_in, "Cache-Control");
-    vary_out = apr_table_get(r->headers_out, "Vary");
-    if (r->no_cache ||
-        ap_cache_liststr(NULL, vary_out, "*", NULL) ||
-        (!conf->store_nostore &&
-         ap_cache_liststr(NULL, cc_in, "no-store", NULL))) {
-        ap_remove_output_filter(f);
-        return ap_pass_brigade(f->next, in);
-    }
-
     /* Setup cache_request_rec */
     cache = (cache_request_rec *) ap_get_module_config(r->request_config,
                                                        &cache_module);
@@ -295,6 +282,8 @@
          */
         rv = cache->provider->store_body(cache->handle, r, in);
         if (rv != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, r->server,
+                         "cache: Cache provider's store_body failed!");
             ap_remove_output_filter(f);
         }
         return ap_pass_brigade(f->next, in);
@@ -434,9 +423,14 @@
          */
         reason = "Authorization required";
     }
+    else if (ap_cache_liststr(NULL, 
+                              apr_table_get(r->headers_out, "Vary"),
+                              "*", NULL)) {
+        reason = "Vary header contains '*'";
+    }
     else if (r->no_cache) {
         /* or we've been asked not to cache it above */
-        reason = "no_cache present";
+        reason = "r->no_cache present";
     }
 
     if (reason) {
@@ -707,6 +701,8 @@
         rv = cache->provider->store_body(cache->handle, r, in);
     }
     if (rv != APR_SUCCESS) {
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, r->server,
+                     "cache: store_body failed");
         ap_remove_output_filter(f);
     }
 



Mime
View raw message