]> granicus.if.org Git - apache/commitdiff
Added code to process min and max file size directives and to
authorPaul J. Reder <rederpj@apache.org>
Thu, 7 Nov 2002 23:11:10 +0000 (23:11 +0000)
committerPaul J. Reder <rederpj@apache.org>
Thu, 7 Nov 2002 23:11:10 +0000 (23:11 +0000)
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

CHANGES
modules/experimental/cache_util.c
modules/experimental/mod_disk_cache.c

diff --git a/CHANGES b/CHANGES
index c32a70967e4c1fd37457d35e970276d2a3d75c47..0a2425db751e05fb4443d508bf11f747f5c03e48 100644 (file)
--- 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 <deva@daoine.org>]
 
index 7bde810dd0d50a0537ae86335aea60ade4c1092e..4d7bc1d5c863e42b7c5d5c58ed0b606092b077bf 100644 (file)
@@ -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;
index 3ad36afe6ec8c321ba3698d6447e2428c6c95fb6..3648a6a99c6baa1c85016d7c9dc93de17f063790 100644 (file)
@@ -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