mod_ldap: Make LDAPSharedCacheSize 0 create a non-shared-memory cache per

process as opposed to disabling caching completely. This allows to use
the non-shared-memory cache as a workaround for the shared memory cache
not being available during graceful restarts

PR: 48958


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096577 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Fritsch
2011-04-25 20:00:43 +00:00
parent bf07c1867c
commit 46dc6e060b
5 changed files with 49 additions and 27 deletions

View File

@ -2728,9 +2728,12 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) {
#if APR_HAS_SHARED_MEMORY
/* If the cache file already exists then delete it. Otherwise we are
* going to run into problems creating the shared memory. */
if (st->cache_file) {
/*
* If we are using shared memory caching and the cache file already
* exists then delete it. Otherwise we are going to run into problems
* creating the shared memory.
*/
if (st->cache_file && st->cache_bytes > 0) {
char *lck_file = apr_pstrcat(ptemp, st->cache_file, ".lck",
NULL);
apr_file_remove(lck_file, ptemp);
@ -2740,10 +2743,10 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
}
#if APR_HAS_SHARED_MEMORY
/* initializing cache if shared memory size is not zero and we already
* don't have shm address
/*
* initializing cache if we don't already have a shm address
*/
if (!st->cache_shm && st->cache_bytes > 0) {
if (!st->cache_shm) {
#endif
result = util_ldap_cache_init(p, st);
if (result != APR_SUCCESS) {
@ -2865,7 +2868,7 @@ static const command_rec util_ldap_cmds[] = {
AP_INIT_TAKE1("LDAPSharedCacheSize", util_ldap_set_cache_bytes,
NULL, RSRC_CONF,
"Set the size of the shared memory cache (in bytes). Use "
"0 to disable the shared memory cache. (default: 100000)"),
"0 to disable the shared memory cache. (default: 500000)"),
AP_INIT_TAKE1("LDAPSharedCacheFile", util_ldap_set_cache_file,
NULL, RSRC_CONF,