mod_cache: Apply the API change that allows future mod_cache providers to
invalidate cache entries, which will fix PR15868.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1208824 13f79535-47bb-0310-9956-
ffa450edef68
* 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 */
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);
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"
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));
&create_entity,
&open_entity,
&remove_url,
- &commit_entity
+ &commit_entity,
+ &invalidate_entity
};
static void disk_cache_register_hook(apr_pool_t *p)