View | Details | Raw Unified | Return to bug 19304
Collapse All | Expand All

(-)../../../clean/httpd-2.0.46/include/util_ldap.h (-1 / +2 lines)
Lines 148-153 Link Here
148
148
149
    struct util_ldap_connection_t *connections;
149
    struct util_ldap_connection_t *connections;
150
    char *cert_auth_file; 
150
    char *cert_auth_file; 
151
    char *shmem_cache; 
151
    int   cert_file_type;
152
    int   cert_file_type;
152
    int   ssl_support;
153
    int   ssl_support;
153
} util_ldap_state_t;
154
} util_ldap_state_t;
Lines 291-297 Link Here
291
 *         apr_smmem_init() call. Regardless of the status, the cache
292
 *         apr_smmem_init() call. Regardless of the status, the cache
292
 *         will be set up at least for in-process or in-thread operation.
293
 *         will be set up at least for in-process or in-thread operation.
293
 */
294
 */
294
apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize);
295
apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize, char *shmem_cache);
295
296
296
/**
297
/**
297
 * Display formatted stats for cache
298
 * Display formatted stats for cache
(-)../../../clean/httpd-2.0.46/modules/experimental/util_ldap.c (-1 / +13 lines)
Lines 1070-1075 Link Here
1070
    return(NULL);
1070
    return(NULL);
1071
}
1071
}
1072
1072
1073
const char *util_ldap_set_shmem_cache(cmd_parms *cmd, void *dummy, const char *shmem_cache)
1074
{
1075
    util_ldap_state_t *st = 
1076
    (util_ldap_state_t *)ap_get_module_config(cmd->server->module_config, 
1077
                                              &ldap_module);
1078
1079
    st->shmem_cache = shmem_cache;
1080
1081
    return(NULL);
1082
}
1073
1083
1074
void *util_ldap_create_config(apr_pool_t *p, server_rec *s)
1084
void *util_ldap_create_config(apr_pool_t *p, server_rec *s)
1075
{
1085
{
Lines 1097-1103 Link Here
1097
        (util_ldap_state_t *)ap_get_module_config(s->module_config, 
1107
        (util_ldap_state_t *)ap_get_module_config(s->module_config, 
1098
						  &ldap_module);
1108
						  &ldap_module);
1099
1109
1100
    apr_status_t result = util_ldap_cache_init(pool, st->cache_bytes);
1110
    apr_status_t result = util_ldap_cache_init(pool, st->cache_bytes, st->shmem_cache);
1101
    char buf[MAX_STRING_LEN];
1111
    char buf[MAX_STRING_LEN];
1102
1112
1103
    apr_strerror(result, buf, sizeof(buf));
1113
    apr_strerror(result, buf, sizeof(buf));
Lines 1325-1330 Link Here
1325
                 "    DER_FILE      - file in binary DER format "
1335
                 "    DER_FILE      - file in binary DER format "
1326
                 "    BASE64_FILE   - file in Base64 format "
1336
                 "    BASE64_FILE   - file in Base64 format "
1327
                 "    CERT7_DB_PATH - Netscape certificate database file "),
1337
                 "    CERT7_DB_PATH - Netscape certificate database file "),
1338
    AP_INIT_TAKE1("LDAPSharedMemCache", util_ldap_set_shmem_cache, NULL, RSRC_CONF,
1339
                 "Specifies the LDAP Cache Shared Memory file. "),
1328
    {NULL}
1340
    {NULL}
1329
};
1341
};
1330
1342
(-)../../../clean/httpd-2.0.46/modules/experimental/util_ldap_cache.c (-3 / +6 lines)
Lines 290-307 Link Here
290
    return APR_SUCCESS;
290
    return APR_SUCCESS;
291
}
291
}
292
292
293
apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize)
293
apr_status_t util_ldap_cache_init(apr_pool_t *pool, apr_size_t reqsize, char *shmem_cache)
294
{
294
{
295
#if APR_HAS_SHARED_MEMORY
295
#if APR_HAS_SHARED_MEMORY
296
    apr_status_t result;
296
    apr_status_t result;
297
    if( shmem_cache == NULL ) {
298
	    shmem_cache=MODLDAP_SHMEM_CACHE;
299
    }
297
300
298
    result = apr_shm_create(&util_ldap_shm, reqsize, MODLDAP_SHMEM_CACHE, pool);
301
    result = apr_shm_create(&util_ldap_shm, reqsize, shmem_cache, pool);
299
    if (result == EEXIST) {
302
    if (result == EEXIST) {
300
        /*
303
        /*
301
         * The cache could have already been created (i.e. we may be a child process).  See
304
         * The cache could have already been created (i.e. we may be a child process).  See
302
         * if we can attach to the existing shared memory
305
         * if we can attach to the existing shared memory
303
         */
306
         */
304
        result = apr_shm_attach(&util_ldap_shm, MODLDAP_SHMEM_CACHE, pool);
307
        result = apr_shm_attach(&util_ldap_shm, shmem_cache, pool);
305
    } 
308
    } 
306
    if (result != APR_SUCCESS) {
309
    if (result != APR_SUCCESS) {
307
        return result;
310
        return result;

Return to bug 19304