httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1208824 - in /httpd/httpd/branches/2.4.x: include/ap_mmn.h modules/cache/mod_cache.c modules/cache/mod_cache.h modules/cache/mod_cache_disk.c
Date Wed, 30 Nov 2011 22:00:44 GMT
Author: minfrin
Date: Wed Nov 30 22:00:43 2011
New Revision: 1208824

URL: http://svn.apache.org/viewvc?rev=1208824&view=rev
Log:
Backport:
mod_cache: Apply the API change that allows future mod_cache providers to
invalidate cache entries, which will fix PR15868.

Modified:
    httpd/httpd/branches/2.4.x/include/ap_mmn.h
    httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c
    httpd/httpd/branches/2.4.x/modules/cache/mod_cache.h
    httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c

Modified: httpd/httpd/branches/2.4.x/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/ap_mmn.h?rev=1208824&r1=1208823&r2=1208824&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/ap_mmn.h (original)
+++ httpd/httpd/branches/2.4.x/include/ap_mmn.h Wed Nov 30 22:00:43 2011
@@ -371,12 +371,13 @@
  *                         add pool to ap_errorlog_info.
  * 20111130.0 (2.4.0-dev)  c->remote_ip becomes c->peer_ip and r->client_ip,
  *                         c->remote_addr becomes c->peer_addr and r->client_addr
+ * 20111201.0 (2.5.0-dev)  Add invalidate_entity() to the cache provider.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20111130
+#define MODULE_MAGIC_NUMBER_MAJOR 20111201
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                   /* 0...n */
 

Modified: httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c?rev=1208824&r1=1208823&r2=1208824&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c Wed Nov 30 22:00:43 2011
@@ -1558,6 +1558,10 @@ static int cache_status(cache_handle_t *
         apr_table_setn(r->subprocess_env, AP_CACHE_MISS_ENV, reason);
         break;
     }
+    case AP_CACHE_INVALIDATE: {
+        apr_table_setn(r->subprocess_env, AP_CACHE_INVALIDATE_ENV, reason);
+        break;
+    }
     }
 
     apr_table_setn(r->subprocess_env, AP_CACHE_STATUS_ENV, reason);

Modified: httpd/httpd/branches/2.4.x/modules/cache/mod_cache.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/mod_cache.h?rev=1208824&r1=1208823&r2=1208824&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/mod_cache.h (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/mod_cache.h Wed Nov 30 22:00:43 2011
@@ -109,17 +109,20 @@ typedef struct {
                            const char *urlkey);
     int (*remove_url) (cache_handle_t *h, request_rec *r);
     apr_status_t (*commit_entity)(cache_handle_t *h, request_rec *r);
+    apr_status_t (*invalidate_entity)(cache_handle_t *h, request_rec *r);
 } cache_provider;
 
 typedef enum {
     AP_CACHE_HIT,
     AP_CACHE_REVALIDATE,
-    AP_CACHE_MISS
+    AP_CACHE_MISS,
+    AP_CACHE_INVALIDATE
 } ap_cache_status_e;
 
 #define AP_CACHE_HIT_ENV "cache-hit"
 #define AP_CACHE_REVALIDATE_ENV "cache-revalidate"
 #define AP_CACHE_MISS_ENV "cache-miss"
+#define AP_CACHE_INVALIDATE_ENV "cache-invalidate"
 #define AP_CACHE_STATUS_ENV "cache-status"
 
 

Modified: httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c?rev=1208824&r1=1208823&r2=1208824&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/mod_cache_disk.c Wed Nov 30 22:00:43 2011
@@ -1325,6 +1325,11 @@ static apr_status_t commit_entity(cache_
     return APR_SUCCESS;
 }
 
+static apr_status_t invalidate_entity(cache_handle_t *h, request_rec *r)
+{
+    return APR_ENOTIMPL;
+}
+
 static void *create_dir_config(apr_pool_t *p, char *dummy)
 {
     disk_cache_dir_conf *dconf = apr_pcalloc(p, sizeof(disk_cache_dir_conf));
@@ -1502,7 +1507,8 @@ static const cache_provider cache_disk_p
     &create_entity,
     &open_entity,
     &remove_url,
-    &commit_entity
+    &commit_entity,
+    &invalidate_entity
 };
 
 static void disk_cache_register_hook(apr_pool_t *p)



Mime
View raw message