MCPcopy Index your code
hub / github.com/apache/httpd / add_cache_disable

Function add_cache_disable

modules/cache/mod_cache.c:2286–2329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2284}
2285
2286static const char *add_cache_disable(cmd_parms *parms, void *dummy,
2287 const char *url)
2288{
2289 cache_dir_conf *dconf = (cache_dir_conf *)dummy;
2290 cache_server_conf *conf;
2291 struct cache_disable *new;
2292
2293 const char *err = ap_check_cmd_context(parms,
2294 NOT_IN_DIRECTORY|NOT_IN_LIMIT|NOT_IN_FILES);
2295 if (err != NULL) {
2296 return err;
2297 }
2298
2299 conf =
2300 (cache_server_conf *)ap_get_module_config(parms->server->module_config,
2301 &cache_module);
2302
2303 if (parms->path) {
2304 if (!strcasecmp(url, "on")) {
2305 dconf->disable = 1;
2306 dconf->disable_set = 1;
2307 return NULL;
2308 }
2309 else {
2310 return "CacheDisable must be followed by the word 'on' when in a Location.";
2311 }
2312 }
2313
2314 if (!url || (url[0] != '/' && !ap_strchr_c(url, ':'))) {
2315 return "CacheDisable must specify a path or an URL.";
2316 }
2317
2318 new = apr_array_push(conf->cachedisable);
2319 if (apr_uri_parse(parms->pool, url, &(new->url))) {
2320 return NULL;
2321 }
2322 if (new->url.path) {
2323 new->pathlen = strlen(new->url.path);
2324 } else {
2325 new->pathlen = 1;
2326 new->url.path = "/";
2327 }
2328 return NULL;
2329}
2330
2331static const char *set_cache_maxex(cmd_parms *parms, void *dummy,
2332 const char *arg)

Callers

nothing calls this directly

Calls 3

ap_check_cmd_contextFunction · 0.85
ap_get_module_configFunction · 0.85
ap_strchr_cFunction · 0.85

Tested by

no test coverage detected