module AP_MODULE_DECLARE_DATA proxy_balancer_module;
+static APR_OPTIONAL_FN_TYPE(set_worker_hc_param) *set_worker_hc_param_f = NULL;
+
static int (*ap_proxy_retry_worker_fn)(const char *proxy_function,
proxy_worker *worker, server_rec *s) = NULL;
if (rv != APR_SUCCESS) {
return rv;
}
-
+ set_worker_hc_param_f = APR_RETRIEVE_OPTIONAL_FN(set_worker_hc_param);
return OK;
}
apr_port_t port = 0;
/* TODO: offset of BALANCER_PREFIX ?? */
- if (strncasecmp(url, "balancer:", 9) == 0) {
+ if (ap_casecmpstrn(url, "balancer:", 9) == 0) {
url += 9;
}
else {
*wsel->s->redirect = '\0';
}
if ((val = apr_table_get(params, "w_status_I"))) {
- ap_proxy_set_wstatus('I', atoi(val), wsel);
+ ap_proxy_set_wstatus(PROXY_WORKER_IGNORE_ERRORS_FLAG, atoi(val), wsel);
}
if ((val = apr_table_get(params, "w_status_N"))) {
- ap_proxy_set_wstatus('N', atoi(val), wsel);
+ ap_proxy_set_wstatus(PROXY_WORKER_DRAIN_FLAG, atoi(val), wsel);
}
if ((val = apr_table_get(params, "w_status_D"))) {
- ap_proxy_set_wstatus('D', atoi(val), wsel);
+ ap_proxy_set_wstatus(PROXY_WORKER_DISABLED_FLAG, atoi(val), wsel);
}
if ((val = apr_table_get(params, "w_status_H"))) {
- ap_proxy_set_wstatus('H', atoi(val), wsel);
+ ap_proxy_set_wstatus(PROXY_WORKER_HOT_STANDBY_FLAG, atoi(val), wsel);
}
if ((val = apr_table_get(params, "w_ls"))) {
int ival = atoi(val);
/* sync all timestamps */
bsel->wupdated = bsel->s->wupdated = nworker->s->updated = apr_time_now();
/* by default, all new workers are disabled */
- ap_proxy_set_wstatus('D', 1, nworker);
+ ap_proxy_set_wstatus(PROXY_WORKER_DISABLED_FLAG, 1, nworker);
}
if ((rv = PROXY_GLOBAL_UNLOCK(bsel)) != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01203)
ap_rputs(" <httpd:balancer>\n", r);
/* Start proxy_balancer */
ap_rvputs(r, " <httpd:name>", balancer->s->name, "</httpd:name>\n", NULL);
- if (balancer->s->sticky) {
+ if (*balancer->s->sticky) {
ap_rvputs(r, " <httpd:stickysession>", balancer->s->sticky,
"</httpd:stickysession>\n", NULL);
ap_rprintf(r,
}
ap_rvputs(r, " <httpd:lbmethod>", balancer->lbmethod->name,
"</httpd:lbmethod>\n", NULL);
- if (balancer->s->sticky) {
+ if (*balancer->s->sticky) {
ap_rprintf(r,
" <httpd:scolonpathdelim>%s</httpd:scolonpathdelim>\n",
(balancer->s->scolonsep ? "On" : "Off"));
ap_rprintf(r, " <httpd:lbset>%d</httpd:lbset>\n",
worker->s->lbset);
/* End proxy_worker_stat */
- if (!strcasecmp(worker->s->scheme, "ajp")) {
+ if (!ap_casecmpstr(worker->s->scheme, "ajp")) {
ap_rputs(" <httpd:flushpackets>", r);
switch (worker->s->flush_packets) {
case flush_off:
" padding: 2px;\n"
" border-style: dotted;\n"
" border-color: gray;\n"
- " background-color: white;\n"
+ " background-color: lightgray;\n"
" text-align: center;\n"
"}\n"
"td {\n"
ap_rprintf(r, "<td>%s</td>\n",
balancer->s->lbpname);
ap_rputs("<td>", r);
- if (balancer->s->vhost && *(balancer->s->vhost)) {
+ if (*balancer->s->vhost) {
ap_rvputs(r, balancer->s->vhost, " -> ", NULL);
}
ap_rvputs(r, balancer->s->vpath, "</td>\n", NULL);
"<th>Worker URL</th>"
"<th>Route</th><th>RouteRedir</th>"
"<th>Factor</th><th>Set</th><th>Status</th>"
- "<th>Elected</th><th>Busy</th><th>Load</th><th>To</th><th>From</th>"
- "</tr>\n", r);
+ "<th>Elected</th><th>Busy</th><th>Load</th><th>To</th><th>From</th>", r);
+ if (set_worker_hc_param_f) {
+ ap_rputs("<th>Method</th><th>Interval</th><th>Passes</th><th>Fails</th><th>URI</th>", r);
+ }
+ ap_rputs("</tr>\n", r);
workers = (proxy_worker **)balancer->workers->elts;
for (n = 0; n < balancer->workers->nelts; n++) {
ap_rputs(apr_strfsize(worker->s->transferred, fbuf), r);
ap_rputs("</td><td>", r);
ap_rputs(apr_strfsize(worker->s->read, fbuf), r);
+ if (set_worker_hc_param_f) {
+ ap_rprintf(r, "</td><td>%s</td>", ap_proxy_show_hcmethod(worker->s->method));
+ ap_rprintf(r, "<td>%d</td>", (int)apr_time_sec(worker->s->interval));
+ ap_rprintf(r, "<td>%d (%d)</td>", worker->s->passes,worker->s->pcount);
+ ap_rprintf(r, "<td>%d (%d)</td>", worker->s->fails, worker->s->fcount);
+ ap_rprintf(r, "<td>%s", worker->s->hcuri);
+ }
ap_rputs("</td></tr>\n", r);
++workers;