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

Function set_proxy_dirconn

modules/proxy/mod_proxy.c:2290–2344  ·  view source on GitHub ↗

Similar to set_proxy_exclude(), but defining directly connected hosts, * which should never be accessed via the configured ProxyRemote servers */

Source from the content-addressed store, hash-verified

2288 * which should never be accessed via the configured ProxyRemote servers
2289 */
2290static const char *
2291 set_proxy_dirconn(cmd_parms *parms, void *dummy, const char *arg)
2292{
2293 server_rec *s = parms->server;
2294 proxy_server_conf *conf =
2295 ap_get_module_config(s->module_config, &proxy_module);
2296 struct dirconn_entry *New;
2297 struct dirconn_entry *list = (struct dirconn_entry *) conf->dirconn->elts;
2298 int found = 0;
2299 int i;
2300
2301 /* Don't duplicate entries */
2302 for (i = 0; i < conf->dirconn->nelts; i++) {
2303 if (strcasecmp(arg, list[i].name) == 0) {
2304 found = 1;
2305 break;
2306 }
2307 }
2308
2309 if (!found) {
2310 New = apr_array_push(conf->dirconn);
2311 New->name = apr_pstrdup(parms->pool, arg);
2312 New->hostaddr = NULL;
2313
2314 if (ap_proxy_is_ipaddr(New, parms->pool)) {
2315#if DEBUGGING
2316 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(03018)
2317 "Parsed addr %s", inet_ntoa(New->addr));
2318 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(03019)
2319 "Parsed mask %s", inet_ntoa(New->mask));
2320#endif
2321 }
2322 else if (ap_proxy_is_domainname(New, parms->pool)) {
2323 ap_str_tolower(New->name);
2324#if DEBUGGING
2325 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(03020)
2326 "Parsed domain %s", New->name);
2327#endif
2328 }
2329 else if (ap_proxy_is_hostname(New, parms->pool)) {
2330 ap_str_tolower(New->name);
2331#if DEBUGGING
2332 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(03021)
2333 "Parsed host %s", New->name);
2334#endif
2335 }
2336 else {
2337 ap_proxy_is_word(New, parms->pool);
2338#if DEBUGGING
2339 fprintf(stderr, "Parsed word %s\n", New->name);
2340#endif
2341 }
2342 }
2343 return NULL;
2344}
2345
2346static const char *
2347 set_proxy_domain(cmd_parms *parms, void *dummy, const char *arg)

Callers

nothing calls this directly

Calls 7

ap_get_module_configFunction · 0.85
ap_proxy_is_ipaddrFunction · 0.85
ap_proxy_is_domainnameFunction · 0.85
ap_str_tolowerFunction · 0.85
ap_proxy_is_hostnameFunction · 0.85
ap_proxy_is_wordFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected