Lines Matching defs:balancer
75 /* Global balancer counter */
867 proxy_balancer *balancer;
870 * First check if mapping against a balancer and see
877 (balancer = ap_proxy_get_balancer(r->pool, sconf, real, 1))) {
879 proxy_worker **worker = (proxy_worker **)balancer->workers->elts;
887 /* The balancer comparison is a bit trickier. Given the context
888 * BalancerMember balancer://alias http://example.com/foo
889 * ProxyPassReverse /bash balancer://alias/bar
892 for (n = 0; n < balancer->workers->nelts; n++) {
1071 * verifies that the balancer name conforms to standards.
1086 proxy_balancer *balancer;
1102 balancer = (proxy_balancer *)conf->balancers->elts;
1104 if (balancer->hash.def == hash.def && balancer->hash.fnv == hash.fnv) {
1105 if (!care || !balancer->s->inactive) {
1106 return balancer;
1109 balancer++;
1116 proxy_balancer *balancer,
1126 if (puri.path && PROXY_STRNCPY(balancer->s->vpath, puri.path) != APR_SUCCESS) {
1127 return apr_psprintf(p, "balancer %s front-end virtual-path (%s) too long",
1128 balancer->s->name, puri.path);
1130 if (puri.hostname && PROXY_STRNCPY(balancer->s->vhost, puri.hostname) != APR_SUCCESS) {
1131 return apr_psprintf(p, "balancer %s front-end vhost name (%s) too long",
1132 balancer->s->name, puri.hostname);
1140 proxy_balancer **balancer,
1155 return "Bad syntax for a balancer name";
1161 *balancer = apr_array_push(conf->balancers);
1162 memset(*balancer, 0, sizeof(proxy_balancer));
1170 (*balancer)->workers = apr_array_make(p, 5, sizeof(proxy_worker *));
1171 (*balancer)->gmutex = NULL;
1172 (*balancer)->tmutex = NULL;
1173 (*balancer)->lbmethod = lbmethod;
1185 return apr_psprintf(p, "balancer name (%s) too long", uri);
1195 return apr_psprintf(p, "balancer safe-name (%s) too long", sname);
1199 (*balancer)->hash = bshared->hash;
1205 (*balancer)->s = bshared;
1206 (*balancer)->sconf = conf;
1208 return ap_proxy_update_balancer(p, *balancer, alias);
1212 * Create an already defined balancer and free up memory.
1214 PROXY_DECLARE(apr_status_t) ap_proxy_share_balancer(proxy_balancer *balancer,
1221 if (!shm || !balancer->s)
1224 if ((balancer->s->hash.def != shm->hash.def) ||
1225 (balancer->s->hash.fnv != shm->hash.fnv)) {
1226 memcpy(shm, balancer->s, sizeof(proxy_balancer_shared));
1227 if (balancer->s->was_malloced)
1228 free(balancer->s);
1232 balancer->s = shm;
1233 balancer->s->index = i;
1236 balancer->s->name);
1238 lbmethod = ap_lookup_provider(PROXY_LBMETHOD, balancer->s->lbpname, "0");
1240 balancer->lbmethod = lbmethod;
1243 "Cannot find LB Method: %s", balancer->s->lbpname);
1246 if (*balancer->s->nonce == PROXY_UNSET_NONCE) {
1254 rv = PROXY_STRNCPY(balancer->s->nonce, nonce);
1259 PROXY_DECLARE(apr_status_t) ap_proxy_initialize_balancer(proxy_balancer *balancer, server_rec *s, apr_pool_t *p)
1262 ap_slotmem_provider_t *storage = balancer->storage;
1268 "no provider for %s", balancer->s->name);
1272 * for each balancer we need to init the global
1275 if (!balancer->gmutex) {
1277 "no mutex %s", balancer->s->name);
1282 rv = apr_global_mutex_child_init(&(balancer->gmutex),
1283 apr_global_mutex_lockfile(balancer->gmutex),
1288 balancer->s->name);
1293 storage->attach(&(balancer->wslot), balancer->s->sname, &size, &num, p);
1294 if (!balancer->wslot) {
1298 if (balancer->lbmethod && balancer->lbmethod->reset)
1299 balancer->lbmethod->reset(balancer, s);
1301 if (balancer->tmutex == NULL) {
1302 rv = apr_thread_mutex_create(&(balancer->tmutex), APR_THREAD_MUTEX_DEFAULT, p);
1305 "can not create balancer thread mutex");
1552 proxy_balancer *balancer,
1606 if (balancer) {
1607 proxy_worker **workers = (proxy_worker **)balancer->workers->elts;
1608 for (i = 0; i < balancer->workers->nelts; i++, workers++) {
1654 proxy_balancer *balancer,
1711 if (balancer) {
1714 runtime = apr_array_push(balancer->workers);
1717 * this balancer *locally* */
1718 balancer->wupdated = apr_time_now();
1770 if (!balancer) {
1777 (*worker)->balancer = balancer;
1785 proxy_balancer *balancer,
1792 err = ap_proxy_define_worker(p, worker, balancer, conf, url, do_malloc);
2013 proxy_balancer **balancer,
2019 access_status = proxy_run_pre_request(worker, balancer, r, conf, url);
2020 if (access_status == DECLINED && *balancer == NULL) {
2026 *balancer = NULL;
2034 *balancer = NULL;
2049 *balancer = NULL;
2062 else if (access_status == DECLINED && *balancer != NULL) {
2072 proxy_balancer *balancer,
2077 if (balancer) {
2078 access_status = proxy_run_post_request(worker, balancer, r, conf);
3157 /* balancer sync */
3209 (*runtime)->balancer = b;
3254 proxy_balancer *balancer,
3264 if ((balancer->s->hash.def == shm->hash.def) &&
3265 (balancer->s->hash.fnv == shm->hash.fnv)) {