--- ../../../clean/httpd-2.0.46/include/util_ldap.h Fri Mar 7 21:12:30 2003 +++ ../../include/util_ldap.h Wed Jun 25 12:18:43 2003 @@ -148,6 +148,7 @@ struct util_ldap_connection_t *connections; char *cert_auth_file; + char *shmem_cache; int cert_file_type; int ssl_support; } util_ldap_state_t; @@ -291,7 +292,7 @@ * apr_smmem_init() call. Regardless of the status, the cache * will be set up at least for in-process or in-thread operation. */ -apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize); +apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize, char *shmem_cache); /** * Display formatted stats for cache --- ../../../clean/httpd-2.0.46/modules/experimental/util_ldap.c Fri May 9 14:58:16 2003 +++ util_ldap.c Wed Jun 25 12:39:18 2003 @@ -1070,6 +1070,16 @@ return(NULL); } +const char *util_ldap_set_shmem_cache(cmd_parms *cmd, void *dummy, const char *shmem_cache) +{ + util_ldap_state_t *st = + (util_ldap_state_t *)ap_get_module_config(cmd->server->module_config, + &ldap_module); + + st->shmem_cache = shmem_cache; + + return(NULL); +} void *util_ldap_create_config(apr_pool_t *p, server_rec *s) { @@ -1097,7 +1107,7 @@ (util_ldap_state_t *)ap_get_module_config(s->module_config, &ldap_module); - apr_status_t result = util_ldap_cache_init(pool, st->cache_bytes); + apr_status_t result = util_ldap_cache_init(pool, st->cache_bytes, st->shmem_cache); char buf[MAX_STRING_LEN]; apr_strerror(result, buf, sizeof(buf)); @@ -1325,6 +1335,8 @@ " DER_FILE - file in binary DER format " " BASE64_FILE - file in Base64 format " " CERT7_DB_PATH - Netscape certificate database file "), + AP_INIT_TAKE1("LDAPSharedMemCache", util_ldap_set_shmem_cache, NULL, RSRC_CONF, + "Specifies the LDAP Cache Shared Memory file. "), {NULL} }; --- ../../../clean/httpd-2.0.46/modules/experimental/util_ldap_cache.c Tue Jan 21 11:51:34 2003 +++ util_ldap_cache.c Wed Jun 25 12:18:13 2003 @@ -290,18 +290,21 @@ return APR_SUCCESS; } -apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize) +apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize, char *shmem_cache) { #if APR_HAS_SHARED_MEMORY apr_status_t result; + if( shmem_cache == NULL ) { + shmem_cache=MODLDAP_SHMEM_CACHE; + } - result = apr_shm_create(&util_ldap_shm, reqsize, MODLDAP_SHMEM_CACHE, pool); + result = apr_shm_create(&util_ldap_shm, reqsize, shmem_cache, pool); if (result == EEXIST) { /* * The cache could have already been created (i.e. we may be a child process). See * if we can attach to the existing shared memory */ - result = apr_shm_attach(&util_ldap_shm, MODLDAP_SHMEM_CACHE, pool); + result = apr_shm_attach(&util_ldap_shm, shmem_cache, pool); } if (result != APR_SUCCESS) { return result;