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

Function balancer_display_page

modules/proxy/mod_proxy_balancer.c:1435–1895  ·  view source on GitHub ↗

* builds the page and links to configure via HTLM or XML. */

Source from the content-addressed store, hash-verified

1433 * builds the page and links to configure via HTLM or XML.
1434 */
1435static void balancer_display_page(request_rec *r, proxy_server_conf *conf,
1436 proxy_balancer *bsel,
1437 proxy_worker *wsel,
1438 int usexml)
1439{
1440 const char *action;
1441 proxy_balancer *balancer;
1442 proxy_worker *worker;
1443 proxy_worker **workers;
1444 int i, n;
1445 action = ap_construct_url(r->pool, r->uri, r);
1446 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01204) "genning page");
1447
1448 if (usexml) {
1449 char date[APR_RFC822_DATE_LEN];
1450 ap_set_content_type_ex(r, "text/xml", 1);
1451 ap_rputs("<?xml version='1.0' encoding='UTF-8' ?>\n", r);
1452 ap_rputs("<httpd:manager xmlns:httpd='http://httpd.apache.org'>\n", r);
1453 ap_rputs(" <httpd:balancers>\n", r);
1454 balancer = (proxy_balancer *)conf->balancers->elts;
1455 for (i = 0; i < conf->balancers->nelts; i++) {
1456 ap_rputs(" <httpd:balancer>\n", r);
1457 /* Start proxy_balancer */
1458 ap_rvputs(r, " <httpd:name>", balancer->s->name, "</httpd:name>\n", NULL);
1459 ap_rvputs(r, " <httpd:nonce>", balancer->s->nonce, "</httpd:nonce>\n", NULL);
1460 if (*balancer->s->sticky) {
1461 ap_rvputs(r, " <httpd:stickysession>", ap_escape_html(r->pool, balancer->s->sticky),
1462 "</httpd:stickysession>\n", NULL);
1463 ap_rprintf(r,
1464 " <httpd:nofailover>%s</httpd:nofailover>\n",
1465 (balancer->s->sticky_force ? "On" : "Off"));
1466 }
1467 ap_rprintf(r,
1468 " <httpd:timeout>%" APR_TIME_T_FMT "</httpd:timeout>",
1469 apr_time_sec(balancer->s->timeout));
1470 if (balancer->s->max_attempts_set) {
1471 ap_rprintf(r,
1472 " <httpd:maxattempts>%d</httpd:maxattempts>\n",
1473 balancer->s->max_attempts);
1474 }
1475 ap_rvputs(r, " <httpd:lbmethod>", balancer->lbmethod->name,
1476 "</httpd:lbmethod>\n", NULL);
1477 if (*balancer->s->sticky) {
1478 ap_rprintf(r,
1479 " <httpd:scolonpathdelim>%s</httpd:scolonpathdelim>\n",
1480 (balancer->s->scolonsep ? "On" : "Off"));
1481 }
1482 /* End proxy_balancer */
1483 ap_rputs(" <httpd:workers>\n", r);
1484 workers = (proxy_worker **)balancer->workers->elts;
1485 for (n = 0; n < balancer->workers->nelts; n++) {
1486 worker = *workers;
1487 /* Start proxy_worker */
1488 ap_rputs(" <httpd:worker>\n", r);
1489 ap_rvputs(r, " <httpd:name>", ap_proxy_worker_name(r->pool, worker),
1490 "</httpd:name>\n", NULL);
1491 ap_rvputs(r, " <httpd:scheme>", worker->s->scheme,
1492 "</httpd:scheme>\n", NULL);

Callers 1

balancer_handlerFunction · 0.85

Calls 15

ap_construct_urlFunction · 0.85
ap_set_content_type_exFunction · 0.85
ap_rputsFunction · 0.85
ap_rvputsFunction · 0.85
ap_rprintfFunction · 0.85
ap_proxy_worker_nameFunction · 0.85
ap_proxy_parse_wstatusFunction · 0.85
ap_cstr_casecmpFunction · 0.85
ap_set_content_typeFunction · 0.85
ap_get_server_nameFunction · 0.85
ap_get_server_builtFunction · 0.85

Tested by

no test coverage detected