]> granicus.if.org Git - apache/commitdiff
mod_cache: Give the cache provider the opportunity to choose to cache
authorGraham Leggett <minfrin@apache.org>
Tue, 21 Sep 2010 20:43:44 +0000 (20:43 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 21 Sep 2010 20:43:44 +0000 (20:43 +0000)
or not cache based on the buckets present in the brigade, such as the
presence of a FILE bucket.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999630 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/cache_storage.c
modules/cache/mod_cache.c
modules/cache/mod_cache.h

diff --git a/CHANGES b/CHANGES
index 32e5c20e90f6c841d268e0b70d48e344c88f4815..a4b6c03eba0f03ee7497004bdd8042384e7b5f73 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,11 @@
 
 Changes with Apache 2.3.9
 
+  *) mod_cache: Give the cache provider the opportunity to choose to cache
+     or not cache based on the buckets present in the brigade, such as the
+     presence of a FILE bucket.
+     [Graham Leggett]
+
   *) mod_authz_core: Allow authz providers to check args while reading the
      config and allow to cache parsed args. [Stefan Fritsch]
 
index cfc0fdfaa02b231016d8fc0d93a268aca2ee053c..4c822d6cd91cf7afddc7332d510b35e9f4a856f9 100644 (file)
@@ -66,7 +66,7 @@ int cache_remove_url(cache_request_rec *cache, apr_pool_t *p)
  * decide whether or not it wants to cache this particular entity.
  * If the size is unknown, a size of -1 should be set.
  */
-int cache_create_entity(request_rec *r, apr_off_t size)
+int cache_create_entity(request_rec *r, apr_off_t size, apr_bucket_brigade *in)
 {
     cache_provider_list *list;
     cache_handle_t *h = apr_pcalloc(r->pool, sizeof(cache_handle_t));
@@ -86,7 +86,7 @@ int cache_create_entity(request_rec *r, apr_off_t size)
     list = cache->providers;
     /* for each specified cache type, delete the URL */
     while (list) {
-        switch (rv = list->provider->create_entity(h, r, key, size)) {
+        switch (rv = list->provider->create_entity(h, r, key, size, in)) {
         case OK: {
             cache->handle = h;
             cache->provider = list->provider;
index 753afba81f19ef75c22280e630a03b8edb74fbd4..cb087a26c6561850ced890b1bfcfc3576956b15e 100644 (file)
@@ -1004,7 +1004,7 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
 
     /* no cache handle, create a new entity only for non-HEAD requests */
     if (!cache->handle && !r->header_only) {
-        rv = cache_create_entity(r, size);
+        rv = cache_create_entity(r, size, in);
         info = apr_pcalloc(r->pool, sizeof(cache_info));
         /* We only set info->status upon the initial creation. */
         info->status = r->status;
index e46f2be55d4537ed0e283d4401cbb0925d9d15b4..eae2646c7eba881f9920359af8c356838724cf5a 100644 (file)
@@ -236,7 +236,7 @@ typedef struct {
     apr_status_t (*recall_headers) (cache_handle_t *h, request_rec *r);
     apr_status_t (*recall_body) (cache_handle_t *h, apr_pool_t *p, apr_bucket_brigade *bb);
     int (*create_entity) (cache_handle_t *h, request_rec *r,
-                           const char *urlkey, apr_off_t len);
+                           const char *urlkey, apr_off_t len, apr_bucket_brigade *bb);
     int (*open_entity) (cache_handle_t *h, request_rec *r,
                            const char *urlkey);
     int (*remove_url) (cache_handle_t *h, apr_pool_t *p);
@@ -388,7 +388,7 @@ CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_hdrs_out(apr_pool_t *pool,
  */
 #define MOD_CACHE_REQUEST_REC "mod_cache_request_rec"
 int cache_remove_url(cache_request_rec *cache, apr_pool_t *p);
-int cache_create_entity(request_rec *r, apr_off_t size);
+int cache_create_entity(request_rec *r, apr_off_t size, apr_bucket_brigade *in);
 int cache_select(request_rec *r);
 apr_status_t cache_generate_key_default( request_rec *r, apr_pool_t*p, char**key );