mirror of
https://github.com/apache/httpd.git
synced 2025-08-05 16:55:50 +03:00
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:
@@ -420,27 +420,29 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
|
||||
apr_status_t result;
|
||||
apr_size_t size;
|
||||
|
||||
if (st->cache_file) {
|
||||
/* Remove any existing shm segment with this name. */
|
||||
apr_shm_remove(st->cache_file, st->pool);
|
||||
}
|
||||
if (st->cache_bytes > 0) {
|
||||
if (st->cache_file) {
|
||||
/* Remove any existing shm segment with this name. */
|
||||
apr_shm_remove(st->cache_file, st->pool);
|
||||
}
|
||||
|
||||
size = APR_ALIGN_DEFAULT(st->cache_bytes);
|
||||
size = APR_ALIGN_DEFAULT(st->cache_bytes);
|
||||
|
||||
result = apr_shm_create(&st->cache_shm, size, st->cache_file, st->pool);
|
||||
if (result != APR_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
result = apr_shm_create(&st->cache_shm, size, st->cache_file, st->pool);
|
||||
if (result != APR_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Determine the usable size of the shm segment. */
|
||||
size = apr_shm_size_get(st->cache_shm);
|
||||
/* Determine the usable size of the shm segment. */
|
||||
size = apr_shm_size_get(st->cache_shm);
|
||||
|
||||
/* This will create a rmm "handler" to get into the shared memory area */
|
||||
result = apr_rmm_init(&st->cache_rmm, NULL,
|
||||
apr_shm_baseaddr_get(st->cache_shm), size,
|
||||
st->pool);
|
||||
if (result != APR_SUCCESS) {
|
||||
return result;
|
||||
/* This will create a rmm "handler" to get into the shared memory area */
|
||||
result = apr_rmm_init(&st->cache_rmm, NULL,
|
||||
apr_shm_baseaddr_get(st->cache_shm), size,
|
||||
st->pool);
|
||||
if (result != APR_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user