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

Function balancer_child_init

modules/proxy/mod_proxy_balancer.c:2015–2049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2013}
2014
2015static void balancer_child_init(apr_pool_t *p, server_rec *s)
2016{
2017 while (s) {
2018 proxy_balancer *balancer;
2019 int i;
2020 void *sconf = s->module_config;
2021 proxy_server_conf *conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module);
2022 apr_status_t rv;
2023
2024 if (conf->balancers->nelts) {
2025 apr_size_t size;
2026 unsigned int num;
2027 storage->attach(&(conf->bslot), conf->id, &size, &num, p);
2028 if (!conf->bslot) {
2029 ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01205) "slotmem_attach failed");
2030 exit(1); /* Ugly, but what else? */
2031 }
2032 }
2033
2034 balancer = (proxy_balancer *)conf->balancers->elts;
2035 for (i = 0; i < conf->balancers->nelts; i++, balancer++) {
2036 rv = ap_proxy_initialize_balancer(balancer, s, p);
2037
2038 if (rv != APR_SUCCESS) {
2039 ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, APLOGNO(01206)
2040 "Failed to init balancer %s in child",
2041 balancer->s->name);
2042 exit(1); /* Ugly, but what else? */
2043 }
2044 init_balancer_members(p, s, balancer);
2045 }
2046 s = s->next;
2047 }
2048
2049}
2050
2051static void ap_proxy_balancer_register_hook(apr_pool_t *p)
2052{

Callers

nothing calls this directly

Calls 4

ap_get_module_configFunction · 0.85
init_balancer_membersFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected