<directivesynopsis>
<name>AuthnCacheSOCache</name>
<description>Select socache backend provider to use</description>
-<syntax>AuthnCacheSOCache <var>provider-name</var></syntax>
+<syntax>AuthnCacheSOCache <var>provider-name[:provider-args]</var></syntax>
<contextlist><context>server config</context></contextlist>
<override>None</override>
<usage>
<p>This is a server-wide setting to select a provider for the
- <a href="../socache.html">shared object cache</a>.
- Values are "dbm", "dc", "memcache", or "shmcb", each subject to the
- appropriate module being loaded. If not set, your platform's
- default will be used.</p>
+ <a href="../socache.html">shared object cache</a>, followed by
+ optional arguments for that provider.
+ Some possible values for <var>provider-name</var> are "dbm", "dc",
+ "memcache", or "shmcb", each subject to the appropriate module
+ being loaded. If not set, your platform's default will be used.</p>
</usage>
</directivesynopsis>
const char *context;
} authn_cache_dircfg;
-/* FIXME: figure out usage of socache create vs init
+/* FIXME:
* I think the cache and mutex should be global
*/
static apr_global_mutex_t *authn_cache_mutex = NULL;
apr_pool_t *ptmp, server_rec *s)
{
apr_status_t rv;
- const char *errmsg;
static struct ap_socache_hints authn_cache_hints = {64, 32, 60000000};
if (!configured) {
}
apr_pool_cleanup_register(pconf, NULL, remove_lock, apr_pool_cleanup_null);
- errmsg = socache_provider->create(&socache_instance, NULL, ptmp, pconf);
- if (errmsg) {
- ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, plog, APLOGNO(01676) "%s", errmsg);
- return 500; /* An HTTP status would be a misnomer! */
- }
-
rv = socache_provider->init(socache_instance, authn_cache_id,
&authn_cache_hints, s, pconf);
if (rv != APR_SUCCESS) {
const char *arg)
{
const char *errmsg = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+ const char *sep, *name;
+
if (errmsg)
return errmsg;
- socache_provider = ap_lookup_provider(AP_SOCACHE_PROVIDER_GROUP, arg,
+
+ /* Argument is of form 'name:args' or just 'name'. */
+ sep = ap_strchr_c(arg, ':');
+ if (sep) {
+ name = apr_pstrmemdup(cmd->pool, arg, sep - arg);
+ sep++;
+ }
+ else {
+ name = arg;
+ }
+
+ socache_provider = ap_lookup_provider(AP_SOCACHE_PROVIDER_GROUP, name,
AP_SOCACHE_PROVIDER_VERSION);
if (socache_provider == NULL) {
errmsg = apr_psprintf(cmd->pool,
"to load the appropriate socache module "
"(mod_socache_%s?)", arg, arg);
}
+ else {
+ errmsg = socache_provider->create(&socache_instance, sep,
+ cmd->temp_pool, cmd->pool);
+ }
+
+ if (errmsg) {
+ errmsg = apr_psprintf(cmd->pool, "AuthnCacheSOCache: %s", errmsg);
+ }
return errmsg;
}