mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@159542 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -428,6 +428,7 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
|
|||||||
|
|
||||||
st->util_ldap_cache =
|
st->util_ldap_cache =
|
||||||
util_ald_create_cache(st,
|
util_ald_create_cache(st,
|
||||||
|
st->search_cache_size,
|
||||||
util_ldap_url_node_hash,
|
util_ldap_url_node_hash,
|
||||||
util_ldap_url_node_compare,
|
util_ldap_url_node_compare,
|
||||||
util_ldap_url_node_copy,
|
util_ldap_url_node_copy,
|
||||||
|
@@ -174,6 +174,7 @@ unsigned long util_ald_hash_string(int nstr, ...);
|
|||||||
void util_ald_cache_purge(util_ald_cache_t *cache);
|
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_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,
|
util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
|
||||||
|
long cache_size,
|
||||||
unsigned long (*hashfunc)(void *),
|
unsigned long (*hashfunc)(void *),
|
||||||
int (*comparefunc)(void *, void *),
|
int (*comparefunc)(void *, void *),
|
||||||
void * (*copyfunc)(util_ald_cache_t *cache, void *),
|
void * (*copyfunc)(util_ald_cache_t *cache, void *),
|
||||||
|
@@ -222,18 +222,21 @@ util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
|
|||||||
|
|
||||||
/* create the three caches */
|
/* create the three caches */
|
||||||
search_cache = util_ald_create_cache(st,
|
search_cache = util_ald_create_cache(st,
|
||||||
|
st->search_cache_size,
|
||||||
util_ldap_search_node_hash,
|
util_ldap_search_node_hash,
|
||||||
util_ldap_search_node_compare,
|
util_ldap_search_node_compare,
|
||||||
util_ldap_search_node_copy,
|
util_ldap_search_node_copy,
|
||||||
util_ldap_search_node_free,
|
util_ldap_search_node_free,
|
||||||
util_ldap_search_node_display);
|
util_ldap_search_node_display);
|
||||||
compare_cache = util_ald_create_cache(st,
|
compare_cache = util_ald_create_cache(st,
|
||||||
|
st->compare_cache_size,
|
||||||
util_ldap_compare_node_hash,
|
util_ldap_compare_node_hash,
|
||||||
util_ldap_compare_node_compare,
|
util_ldap_compare_node_compare,
|
||||||
util_ldap_compare_node_copy,
|
util_ldap_compare_node_copy,
|
||||||
util_ldap_compare_node_free,
|
util_ldap_compare_node_free,
|
||||||
util_ldap_compare_node_display);
|
util_ldap_compare_node_display);
|
||||||
dn_compare_cache = util_ald_create_cache(st,
|
dn_compare_cache = util_ald_create_cache(st,
|
||||||
|
st->compare_cache_size,
|
||||||
util_ldap_dn_compare_node_hash,
|
util_ldap_dn_compare_node_hash,
|
||||||
util_ldap_dn_compare_node_compare,
|
util_ldap_dn_compare_node_compare,
|
||||||
util_ldap_dn_compare_node_copy,
|
util_ldap_dn_compare_node_copy,
|
||||||
@@ -261,6 +264,7 @@ util_url_node_t *util_ald_create_caches(util_ldap_state_t *st, const char *url)
|
|||||||
|
|
||||||
|
|
||||||
util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
|
util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
|
||||||
|
long cache_size,
|
||||||
unsigned long (*hashfunc)(void *),
|
unsigned long (*hashfunc)(void *),
|
||||||
int (*comparefunc)(void *, void *),
|
int (*comparefunc)(void *, void *),
|
||||||
void * (*copyfunc)(util_ald_cache_t *cache, void *),
|
void * (*copyfunc)(util_ald_cache_t *cache, void *),
|
||||||
@@ -270,7 +274,7 @@ util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
|
|||||||
util_ald_cache_t *cache;
|
util_ald_cache_t *cache;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
|
||||||
if (st->search_cache_size <= 0)
|
if (cache_size <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#if APR_HAS_SHARED_MEMORY
|
#if APR_HAS_SHARED_MEMORY
|
||||||
@@ -291,9 +295,9 @@ util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
|
|||||||
cache->rmm_addr = st->cache_rmm;
|
cache->rmm_addr = st->cache_rmm;
|
||||||
cache->shm_addr = st->cache_shm;
|
cache->shm_addr = st->cache_shm;
|
||||||
#endif
|
#endif
|
||||||
cache->maxentries = st->search_cache_size;
|
cache->maxentries = cache_size;
|
||||||
cache->numentries = 0;
|
cache->numentries = 0;
|
||||||
cache->size = st->search_cache_size / 3;
|
cache->size = cache_size / 3;
|
||||||
if (cache->size < 64) cache->size = 64;
|
if (cache->size < 64) cache->size = 64;
|
||||||
for (i = 0; primes[i] && primes[i] < cache->size; ++i) ;
|
for (i = 0; primes[i] && primes[i] < cache->size; ++i) ;
|
||||||
cache->size = primes[i]? primes[i] : primes[i-1];
|
cache->size = primes[i]? primes[i] : primes[i-1];
|
||||||
@@ -526,7 +530,7 @@ char *util_ald_cache_display_stats(request_rec *r, util_ald_cache_t *cache, char
|
|||||||
buf);
|
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;
|
return buf;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user