diff options
Diffstat (limited to 'modules/aaa/mod_authn_socache.c')
-rw-r--r-- | modules/aaa/mod_authn_socache.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/aaa/mod_authn_socache.c b/modules/aaa/mod_authn_socache.c index f36d49c8..140f3b7d 100644 --- a/modules/aaa/mod_authn_socache.c +++ b/modules/aaa/mod_authn_socache.c @@ -87,6 +87,7 @@ static int authn_cache_post_config(apr_pool_t *pconf, apr_pool_t *plog, { apr_status_t rv; static struct ap_socache_hints authn_cache_hints = {64, 32, 60000000}; + const char *errmsg; if (!configured) { return OK; /* don't waste the overhead of creating mutex & cache */ @@ -99,6 +100,20 @@ static int authn_cache_post_config(apr_pool_t *pconf, apr_pool_t *plog, return 500; /* An HTTP status would be a misnomer! */ } + /* We have socache_provider, but do not have socache_instance. This should + * happen only when using "default" socache_provider, so create default + * socache_instance in this case. */ + if (socache_instance == NULL) { + errmsg = socache_provider->create(&socache_instance, NULL, + ptmp, pconf); + if (errmsg) { + ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, plog, APLOGNO(02612) + "failed to create mod_socache_shmcb socache " + "instance: %s", errmsg); + return 500; + } + } + rv = ap_global_mutex_create(&authn_cache_mutex, NULL, authn_cache_id, NULL, s, pconf, 0); if (rv != APR_SUCCESS) { |