httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_mem_cache.c
Date Mon, 01 Apr 2002 22:06:50 GMT
stoddard    02/04/01 14:06:50

  Modified:    modules/experimental mod_mem_cache.c
  Log:
  Fix some of the cache size checks.
  
  Revision  Changes    Path
  1.44      +10 -11    httpd-2.0/modules/experimental/mod_mem_cache.c
  
  Index: mod_mem_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- mod_mem_cache.c	1 Apr 2002 16:09:46 -0000	1.43
  +++ mod_mem_cache.c	1 Apr 2002 22:06:49 -0000	1.44
  @@ -110,9 +110,9 @@
       apr_size_t object_cnt;
   
       /* Fields set by config directives */
  -    apr_size_t min_cache_object_size;
  -    apr_size_t max_cache_object_size;
  -    apr_size_t max_cache_size;
  +    apr_size_t min_cache_object_size;   /* in bytes */
  +    apr_size_t max_cache_object_size;   /* in bytes */
  +    apr_size_t max_cache_size;          /* in bytes */
       apr_size_t max_object_cnt;
   
   } mem_cache_conf;
  @@ -290,7 +290,7 @@
       /* Number of objects in the cache */
       sconf->max_object_cnt = DEFAULT_MAX_OBJECT_CNT;
       sconf->object_cnt = 0;
  -    /* Size of the cache in KB */
  +    /* Size of the cache in bytes */
       sconf->max_cache_size = DEFAULT_MAX_CACHE_SIZE;
       sconf->cache_size = 0;
   
  @@ -838,12 +838,12 @@
   static const char 
   *set_max_cache_size(cmd_parms *parms, void *in_struct_ptr, const char *arg)
   {
  -    int val;
  +    apr_size_t val;
   
       if (sscanf(arg, "%d", &val) != 1) {
  -        return "CacheSize value must be an integer (kBytes)";
  +        return "CacheSize argument must be an integer representing the max cache size in
KBytes.";
       }
  -    sconf->max_cache_size = val;
  +    sconf->max_cache_size = val*1024;
       return NULL;
   }
   static const char 
  @@ -863,7 +863,7 @@
       apr_size_t val;
   
       if (sscanf(arg, "%d", &val) != 1) {
  -        return "CacheMaxObjectSize value must be an integer (KB)";
  +        return "CacheMaxObjectSize value must be an integer (bytes)";
       }
       sconf->max_cache_object_size = val;
       return NULL;
  @@ -883,13 +883,13 @@
   static const command_rec cache_cmds[] =
   {
       AP_INIT_TAKE1("CacheSize", set_max_cache_size, NULL, RSRC_CONF,
  -     "The maximum space used by the cache in KB"),
  +     "The maximum amount of memory used by the cache in KBytes"),
       AP_INIT_TAKE1("CacheMaxObjectCount", set_max_object_count, NULL, RSRC_CONF,
        "The maximum number of objects allowed to be placed in the cache"),
       AP_INIT_TAKE1("CacheMinObjectSize", set_min_cache_object_size, NULL, RSRC_CONF,
        "The minimum size (in bytes) of an object to be placed in the cache"),
       AP_INIT_TAKE1("CacheMaxObjectSize", set_max_cache_object_size, NULL, RSRC_CONF,
  -     "The maximum size (in KB) of an object to be placed in the cache"),
  +     "The maximum size (in bytes) of an object to be placed in the cache"),
       {NULL}
   };
   
  @@ -912,4 +912,3 @@
       cache_cmds,              /* command apr_table_t */
       register_hooks
   };
  -
  
  
  

Mime
View raw message