MCPcopy Create free account
hub / github.com/apache/httpd / set_cache_socache

Function set_cache_socache

modules/cache/mod_cache_socache.c:1230–1260  ·  view source on GitHub ↗

* mod_cache_socache configuration directives handlers. */

Source from the content-addressed store, hash-verified

1228 * mod_cache_socache configuration directives handlers.
1229 */
1230static const char *set_cache_socache(cmd_parms *cmd, void *in_struct_ptr,
1231 const char *arg)
1232{
1233 cache_socache_conf *conf = ap_get_module_config(cmd->server->module_config,
1234 &cache_socache_module);
1235 cache_socache_provider_conf *provider = conf->provider
1236 = apr_pcalloc(cmd->pool, sizeof(cache_socache_provider_conf));
1237
1238 const char *err = NULL, *sep, *name;
1239
1240 /* Argument is of form 'name:args' or just 'name'. */
1241 sep = ap_strchr_c(arg, ':');
1242 if (sep) {
1243 name = apr_pstrmemdup(cmd->pool, arg, sep - arg);
1244 sep++;
1245 provider->args = sep;
1246 }
1247 else {
1248 name = arg;
1249 }
1250
1251 provider->socache_provider = ap_lookup_provider(AP_SOCACHE_PROVIDER_GROUP,
1252 name, AP_SOCACHE_PROVIDER_VERSION);
1253 if (provider->socache_provider == NULL) {
1254 err = apr_psprintf(cmd->pool,
1255 "Unknown socache provider '%s'. Maybe you need "
1256 "to load the appropriate socache module "
1257 "(mod_socache_%s?)", name, name);
1258 }
1259 return err;
1260}
1261
1262static const char *set_cache_max(cmd_parms *parms, void *in_struct_ptr,
1263 const char *arg)

Callers

nothing calls this directly

Calls 3

ap_get_module_configFunction · 0.85
ap_strchr_cFunction · 0.85
ap_lookup_providerFunction · 0.85

Tested by

no test coverage detected