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

Function add_pass

modules/proxy/mod_proxy.c:1973–2173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1971}
1972
1973static const char *
1974 add_pass(cmd_parms *cmd, void *dummy, const char *arg, int is_regex)
1975{
1976 proxy_dir_conf *dconf = (proxy_dir_conf *)dummy;
1977 server_rec *s = cmd->server;
1978 proxy_server_conf *conf =
1979 (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
1980 struct proxy_alias *new;
1981 char *f = cmd->path;
1982 char *r = NULL;
1983 const char *real;
1984 char *word;
1985 apr_table_t *params = apr_table_make(cmd->pool, 5);
1986 const apr_array_header_t *arr;
1987 const apr_table_entry_t *elts;
1988 int i;
1989 unsigned int worker_type = (is_regex) ? AP_PROXY_WORKER_IS_MATCH
1990 : AP_PROXY_WORKER_IS_PREFIX;
1991 unsigned int flags = 0;
1992 const char *err;
1993
1994 err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES);
1995 if (err) {
1996 return err;
1997 }
1998
1999 while (*arg) {
2000 word = ap_getword_conf(cmd->pool, &arg);
2001 if (!f) {
2002 if (!strcmp(word, "~")) {
2003 if (is_regex) {
2004 return "ProxyPassMatch invalid syntax ('~' usage).";
2005 }
2006 worker_type = AP_PROXY_WORKER_IS_MATCH;
2007 continue;
2008 }
2009 f = word;
2010 }
2011 else if (!r) {
2012 r = word;
2013 }
2014 else if (!strcasecmp(word,"nocanon")) {
2015 flags |= PROXYPASS_NOCANON;
2016 }
2017 else if (!strcasecmp(word,"interpolate")) {
2018 flags |= PROXYPASS_INTERPOLATE;
2019 }
2020 else if (!strcasecmp(word,"noquery")) {
2021 flags |= PROXYPASS_NOQUERY;
2022 }
2023 else {
2024 char *val = strchr(word, '=');
2025 if (!val) {
2026 if (cmd->path) {
2027 if (*r == '/') {
2028 return "ProxyPass|ProxyPassMatch can not have a path when defined in "
2029 "a location.";
2030 }

Callers 2

add_pass_noregexFunction · 0.85
add_pass_regexFunction · 0.85

Calls 15

ap_get_module_configFunction · 0.85
ap_check_cmd_contextFunction · 0.85
ap_getword_confFunction · 0.85
ap_proxy_de_socketfyFunction · 0.85
ap_pregcompFunction · 0.85
ap_proxy_get_balancerFunction · 0.85
ap_proxy_define_balancerFunction · 0.85
ap_proxy_update_balancerFunction · 0.85
set_balancer_paramFunction · 0.85
ap_proxy_get_worker_exFunction · 0.85

Tested by

no test coverage detected