]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_cache: Don't regenerate the cache key if we have already generated it.
authorGraham Leggett <minfrin@apache.org>
Mon, 4 Oct 2010 19:27:22 +0000 (19:27 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 4 Oct 2010 19:27:22 +0000 (19:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004373 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/cache_storage.c

index d96b76c16226e66961b60cd9e3f9d6c959b77cec..c0bea512621f2cbed5c09a38ae7d6c906fcc1db7 100644 (file)
@@ -84,9 +84,11 @@ int cache_create_entity(cache_request_rec *cache, request_rec *r,
         return APR_EGENERAL;
     }
 
-    rv = cache_generate_key(r, r->pool, &cache->key);
-    if (rv != APR_SUCCESS) {
-        return rv;
+    if (!cache->key) {
+        rv = cache_generate_key(r, r->pool, &cache->key);
+        if (rv != APR_SUCCESS) {
+            return rv;
+        }
     }
 
     list = cache->providers;
@@ -207,9 +209,11 @@ int cache_select(cache_request_rec *cache, request_rec *r)
         return APR_EGENERAL;
     }
 
-    rv = cache_generate_key(r, r->pool, &cache->key);
-    if (rv != APR_SUCCESS) {
-        return rv;
+    if (!cache->key) {
+        rv = cache_generate_key(r, r->pool, &cache->key);
+        if (rv != APR_SUCCESS) {
+            return rv;
+        }
     }
 
     if (!ap_cache_check_allowed(r)) {