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

Function balancer_manage

modules/proxy/mod_proxy_balancer.c:1399–1430  ·  view source on GitHub ↗

* Process a request for balancer or worker management from another module */

Source from the content-addressed store, hash-verified

1397 * Process a request for balancer or worker management from another module
1398 */
1399static apr_status_t balancer_manage(request_rec *r, apr_table_t *params)
1400{
1401 void *sconf;
1402 proxy_server_conf *conf;
1403 proxy_balancer *bsel = NULL;
1404 proxy_worker *wsel = NULL;
1405 const char *name;
1406 sconf = r->server->module_config;
1407 conf = (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module);
1408
1409 /* Process the parameters */
1410 if ((name = apr_table_get(params, "b"))) {
1411 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "balancer_manage "
1412 "balancer: %s", name);
1413 bsel = ap_proxy_get_balancer(r->pool, conf,
1414 apr_pstrcat(r->pool, BALANCER_PREFIX, name, NULL), 0);
1415 }
1416
1417 if ((name = apr_table_get(params, "w"))) {
1418 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "balancer_manage "
1419 "worker: %s", name);
1420 wsel = ap_proxy_get_worker(r->pool, bsel, conf, name);
1421 }
1422 if (bsel) {
1423 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "balancer_manage "
1424 "balancer: %s", bsel->s->name);
1425 return(balancer_process_balancer_worker(r, conf, bsel, wsel, params));
1426 }
1427 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "balancer_manage failed: "
1428 "No balancer!");
1429 return HTTP_BAD_REQUEST;
1430}
1431
1432/*
1433 * builds the page and links to configure via HTLM or XML.

Callers

nothing calls this directly

Calls 4

ap_get_module_configFunction · 0.85
ap_proxy_get_balancerFunction · 0.85
ap_proxy_get_workerFunction · 0.85

Tested by

no test coverage detected