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 Tue, 04 Jun 2002 20:08:48 GMT
stoddard    2002/06/04 13:08:47

  Modified:    modules/experimental mod_mem_cache.c
  Log:
  The number of collision chains in cache_hash is MCacheMaxObjectCount or
  DEFAULT_MAX_OBJECT_CNT (changed from 512)
  
  Revision  Changes    Path
  1.63      +12 -4     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.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- mod_mem_cache.c	4 Jun 2002 17:30:59 -0000	1.62
  +++ mod_mem_cache.c	4 Jun 2002 20:08:47 -0000	1.63
  @@ -113,7 +113,7 @@
   #define DEFAULT_MAX_CACHE_SIZE 100*1024
   #define DEFAULT_MIN_CACHE_OBJECT_SIZE 0
   #define DEFAULT_MAX_CACHE_OBJECT_SIZE 10000
  -#define DEFAULT_MAX_OBJECT_CNT 1000
  +#define DEFAULT_MAX_OBJECT_CNT 1009
   #define CACHEFILE_LEN 20
   
   /* Forward declarations */
  @@ -289,8 +289,6 @@
       if (threaded_mpm) {
           apr_thread_mutex_create(&sconf->lock, APR_THREAD_MUTEX_DEFAULT, p);
       }
  -    /* Todo: determine hash table size from max_cache_object_cnt */
  -    sconf->cacheht = cache_hash_make(512);
   
       sconf->min_cache_object_size = DEFAULT_MIN_CACHE_OBJECT_SIZE;
       sconf->max_cache_object_size = DEFAULT_MAX_CACHE_OBJECT_SIZE;
  @@ -849,6 +847,15 @@
       }
       return APR_SUCCESS;
   }
  +/**
  + * Configuration and start-up
  + */
  +static int mem_cache_post_config(apr_pool_t *p, apr_pool_t *plog,
  +                                 apr_pool_t *ptemp, server_rec *s)
  +{
  +    sconf->cacheht = cache_hash_make(sconf->max_object_cnt);
  +    return OK;
  +}
   
   static const char 
   *set_max_cache_size(cmd_parms *parms, void *in_struct_ptr, const char *arg)
  @@ -910,8 +917,9 @@
   
   static void register_hooks(apr_pool_t *p)
   {
  +    ap_hook_post_config(mem_cache_post_config, NULL, NULL, APR_HOOK_MIDDLE);
       /* cache initializer */
  -/*    cache_hook_cache_init(cache_init, NULL, NULL, AP_HOOK_FIRST); */
  +    /* cache_hook_cache_init(cache_init, NULL, NULL, AP_HOOK_FIRST); */
       cache_hook_create_entity(create_entity, NULL, NULL, APR_HOOK_MIDDLE);
       cache_hook_open_entity(open_entity,  NULL, NULL, APR_HOOK_MIDDLE);
       cache_hook_remove_url(remove_url, NULL, NULL, APR_HOOK_MIDDLE);
  
  
  

Mime
View raw message