From: Paul J. Reder Date: Thu, 7 Nov 2002 23:11:10 +0000 (+0000) Subject: Added code to process min and max file size directives and to X-Git-Tag: 2.0.44~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0746450148ac58ec07d7deda05d44fafe426099;p=apache Added code to process min and max file size directives and to init the expirychk flag in mod_disk_cache. Added a clarifying comment to cache_util. [Paul J. Reder] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97450 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c32a70967e..0a2425db75 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.44 + *) Added code to process min and max file size directives and to + init the expirychk flag in mod_disk_cache. Added a clarifying + comment to cache_util. [Paul J. Reder] + *) The value emitted by ServerSignature now mimics the Server HTTP header as controlled by ServerTokens. [Francis Daly ] diff --git a/modules/experimental/cache_util.c b/modules/experimental/cache_util.c index 7bde810dd0..4d7bc1d5c8 100644 --- a/modules/experimental/cache_util.c +++ b/modules/experimental/cache_util.c @@ -124,6 +124,8 @@ CACHE_DECLARE(const char *)ap_cache_get_cachetype(request_rec *r, } /* then loop through all the cachedisable entries */ + /* Looking for urls that contain the full cachedisable url and possibly more. */ + /* This means we are disabling cachedisable url and below... */ for (i = 0; i < conf->cachedisable->nelts; i++) { struct cache_disable *ent = (struct cache_disable *)conf->cachedisable->elts; diff --git a/modules/experimental/mod_disk_cache.c b/modules/experimental/mod_disk_cache.c index 3ad36afe6e..3648a6a99c 100644 --- a/modules/experimental/mod_disk_cache.c +++ b/modules/experimental/mod_disk_cache.c @@ -333,6 +333,14 @@ static int create_entity(cache_handle_t *h, request_rec *r, return DECLINED; } + if (len < conf->minfs || len > conf->maxfs) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "cache_disk: URL %s failed the size check, " + "or is incomplete", + key); + return DECLINED; + } + /* Allocate and initialize cache_object_t and disk_cache_object_t */ obj = apr_pcalloc(r->pool, sizeof(*obj)); obj->vobj = dobj = apr_pcalloc(r->pool, sizeof(*dobj)); @@ -678,6 +686,7 @@ static void *create_config(apr_pool_t *p, server_rec *s) conf->space = DEFAULT_CACHE_SIZE; conf->maxfs = DEFAULT_MAX_FILE_SIZE; conf->minfs = DEFAULT_MIN_FILE_SIZE; + conf->expirychk = 1; conf->cache_root = NULL; conf->cache_root_len = 0; @@ -753,10 +762,10 @@ static const char static const char *set_cache_exchk(cmd_parms *parms, void *in_struct_ptr, int flag) { - /* XXX disk_cache_conf *conf = ap_get_module_config(parms->server->module_config, &disk_cache_module); - */ + conf->expirychk = flag; + return NULL; } static const char