httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject svn commit: r159542 - httpd/httpd/trunk/modules/ldap/util_ldap_cache.c httpd/httpd/trunk/modules/ldap/util_ldap_cache.h httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c
Date Wed, 30 Mar 2005 23:25:49 GMT
Author: bnicholes
Date: Wed Mar 30 15:25:47 2005
New Revision: 159542

URL: http://svn.apache.org/viewcvs?view=rev&rev=159542
Log:
Actually use the compare_cache_size value that is being set by LDAPOpCacheEntries.  The actual
cache_size was previously defaulting to the value of search _cache_size set by LDAPCacheEntries.

Modified:
    httpd/httpd/trunk/modules/ldap/util_ldap_cache.c
    httpd/httpd/trunk/modules/ldap/util_ldap_cache.h
    httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c

Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap_cache.c?view=diff&r1=159541&r2=159542
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap_cache.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap_cache.c Wed Mar 30 15:25:47 2005
@@ -428,6 +428,7 @@
 
     st->util_ldap_cache =
         util_ald_create_cache(st,
+                              st->search_cache_size,
                               util_ldap_url_node_hash,
                               util_ldap_url_node_compare,
                               util_ldap_url_node_copy,

Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap_cache.h?view=diff&r1=159541&r2=159542
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap_cache.h (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap_cache.h Wed Mar 30 15:25:47 2005
@@ -174,6 +174,7 @@
 void util_ald_cache_purge(util_ald_cache_t *cache);
 util_url_node_t *util_ald_create_caches(util_ldap_state_t *s, const char *url);
 util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
+                                long cache_size,
                                 unsigned long (*hashfunc)(void *), 
                                 int (*comparefunc)(void *, void *),
                                 void * (*copyfunc)(util_ald_cache_t *cache, void *),

Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c?view=diff&r1=159541&r2=159542
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c Wed Mar 30 15:25:47 2005
@@ -179,7 +179,7 @@
 
     if (!cache)
         return;
-  
+
     cache->last_purge = apr_time_now();
     cache->npurged = 0;
     cache->numpurges++;
@@ -222,18 +222,21 @@
 
     /* create the three caches */
     search_cache = util_ald_create_cache(st,
+                      st->search_cache_size,
                       util_ldap_search_node_hash,
                       util_ldap_search_node_compare,
                       util_ldap_search_node_copy,
                       util_ldap_search_node_free,
                       util_ldap_search_node_display);
     compare_cache = util_ald_create_cache(st,
+                      st->compare_cache_size,
                       util_ldap_compare_node_hash,
                       util_ldap_compare_node_compare,
                       util_ldap_compare_node_copy,
                       util_ldap_compare_node_free,
                       util_ldap_compare_node_display);
     dn_compare_cache = util_ald_create_cache(st,
+                      st->compare_cache_size,
                       util_ldap_dn_compare_node_hash,
                       util_ldap_dn_compare_node_compare,
                       util_ldap_dn_compare_node_copy,
@@ -261,6 +264,7 @@
 
 
 util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
+                                long cache_size,
                                 unsigned long (*hashfunc)(void *), 
                                 int (*comparefunc)(void *, void *),
                                 void * (*copyfunc)(util_ald_cache_t *cache, void *),
@@ -270,7 +274,7 @@
     util_ald_cache_t *cache;
     unsigned long i;
 
-    if (st->search_cache_size <= 0)
+    if (cache_size <= 0)
         return NULL;
 
 #if APR_HAS_SHARED_MEMORY
@@ -291,9 +295,9 @@
     cache->rmm_addr = st->cache_rmm;
     cache->shm_addr = st->cache_shm;
 #endif
-    cache->maxentries = st->search_cache_size;
+    cache->maxentries = cache_size;
     cache->numentries = 0;
-    cache->size = st->search_cache_size / 3;
+    cache->size = cache_size / 3;
     if (cache->size < 64) cache->size = 64;
         for (i = 0; primes[i] && primes[i] < cache->size; ++i) ;
             cache->size = primes[i]? primes[i] : primes[i-1];
@@ -526,7 +530,7 @@
              buf);
     }
 
-    buf = apr_psprintf(p, "%s<td align='right'>%.2g</td>\n</tr>", buf,
cache->avg_purgetime);
+    buf = apr_psprintf(p, "%s<td align='right'>%.2gms</td>\n</tr>", buf,
cache->avg_purgetime);
 
     return buf;
 }



Mime
View raw message