From: Bill Stoddard Date: Fri, 24 Aug 2001 17:21:39 +0000 (+0000) Subject: Fix seg fault when requesting a page that returns a 'don't cache' header. X-Git-Tag: 2.0.25~73 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e224facaa97284007b8db58b1d2c16ff6189b23;p=apache Fix seg fault when requesting a page that returns a 'don't cache' header. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90642 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/cache_storage.c b/modules/experimental/cache_storage.c index 2f4580324a..8dec2c737c 100644 --- a/modules/experimental/cache_storage.c +++ b/modules/experimental/cache_storage.c @@ -80,8 +80,9 @@ int cache_remove_url(request_rec *r, const char *types, char *url) const char *type; /* for each specified cache type, delete the URL */ - while ((type = ap_cache_tokstr(r->pool, next, &next))) { - cache_run_remove_url(type, url); + while(next) { + type = ap_cache_tokstr(r->pool, next, &next); + cache_run_remove_url(type, url); } return OK; } @@ -132,14 +133,10 @@ int cache_create_entity(request_rec *r, const char *types, char *url, apr_size_t * The specific entity referenced by the cache_handle is removed * from the cache, and the cache_handle is closed. */ +/* XXX Don't think we need to pass in request_rec or types ... */ int cache_remove_entity(request_rec *r, const char *types, cache_handle *h) { - const char *next = types; - const char *type; - - while (next) { - type = ap_cache_tokstr(r->pool, next, &next); - } + h->remove_entity(h); return 1; } diff --git a/modules/experimental/mod_cache.c b/modules/experimental/mod_cache.c index 1fc02cbf09..406cb69d17 100644 --- a/modules/experimental/mod_cache.c +++ b/modules/experimental/mod_cache.c @@ -480,7 +480,10 @@ int ap_cache_in_filter(ap_filter_t *f, apr_bucket_brigade *in) ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, r->server, "cache: response is not cachable"); - /* remove this object from the cache */ + /* remove this object from the cache + * BillS Asks.. Why do we need to make this call to remove_url? + * leave it in for now.. + */ cache_remove_url(r, cache->types, url); /* remove this filter from the chain */