git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@386477
13f79535-47bb-0310-9956-
ffa450edef68
#if APR_HAS_THREADS
/* mutex lock this function */
#if APR_HAS_THREADS
/* mutex lock this function */
- if (!st->mutex) {
- apr_thread_mutex_create(&st->mutex, APR_THREAD_MUTEX_DEFAULT,
- st->pool);
- }
apr_thread_mutex_lock(st->mutex);
#endif
apr_thread_mutex_lock(st->mutex);
#endif
/* Grab the dn, copy it into the pool, and free it again */
dn = ldap_get_dn(ldc->ldap, entry);
/* Grab the dn, copy it into the pool, and free it again */
dn = ldap_get_dn(ldc->ldap, entry);
- *binddn = apr_pstrdup(st->pool, dn);
+ *binddn = apr_pstrdup(r->pool, dn);
util_ldap_state_t *st =
(util_ldap_state_t *)apr_pcalloc(p, sizeof(util_ldap_state_t));
util_ldap_state_t *st =
(util_ldap_state_t *)apr_pcalloc(p, sizeof(util_ldap_state_t));
+ /* Create a pool for mod_ldap to use */
+ apr_pool_create(&st->pool, p);
+#if APR_HAS_THREADS
+ apr_thread_mutex_create(&st->mutex, APR_THREAD_MUTEX_DEFAULT, st->pool);
+#endif
st->cache_bytes = 100000;
st->search_cache_ttl = 600000000;
st->cache_bytes = 100000;
st->search_cache_ttl = 600000000;
util_ldap_state_t *base = (util_ldap_state_t *) basev;
util_ldap_state_t *overrides = (util_ldap_state_t *) overridesv;
util_ldap_state_t *base = (util_ldap_state_t *) basev;
util_ldap_state_t *overrides = (util_ldap_state_t *) overridesv;
+ st->pool = base->pool;
+#if APR_HAS_THREADS
+ st->mutex = base->mutex;
+#endif
st->cache_bytes = base->cache_bytes;
st->search_cache_ttl = base->search_cache_ttl;
st->cache_bytes = base->cache_bytes;
st->search_cache_ttl = base->search_cache_ttl;
/* 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 the cache file already exists then delete it. Otherwise we are
* going to run into problems creating the shared memory. */
if (st->cache_file) {
- char *lck_file = apr_pstrcat(st->pool, st->cache_file, ".lck",
+ char *lck_file = apr_pstrcat(ptemp, st->cache_file, ".lck",
NULL);
apr_file_remove(lck_file, ptemp);
}
NULL);
apr_file_remove(lck_file, ptemp);
}