-#define FIX_15207
/* Copyright 1999-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
int ival;
if (!strcasecmp(key, "loadfactor")) {
- /* Worker load factor. Used with BalancerMamber
- * It is a number between 1 and 100 in percents.
+ /* Normalized load factor. Used with BalancerMamber,
+ * it is a number between 1 and 100.
*/
worker->lbfactor = atoi(val);
if (worker->lbfactor < 1 || worker->lbfactor > 100)
balancer->max_attempts = ival;
balancer->max_attempts_set = 1;
}
+ else if (!strcasecmp(key, "lbmethod")) {
+ /* Which LB scheduler method */
+ if (!strcasecmp(val, "traffic"))
+ balancer->lbmethod = lbmethod_traffic;
+ else if (!strcasecmp(val, "requests"))
+ balancer->lbmethod = lbmethod_requests;
+ else
+ return "lbmethod must be Traffic|Requests";
+ }
else {
return "unknown Balancer parameter";
}
if (conf->req && r->parsed_uri.scheme) {
/* but it might be something vhosted */
if (!(r->parsed_uri.hostname
- && !strcasecmp(r->parsed_uri.scheme, ap_http_method(r))
+ && !strcasecmp(r->parsed_uri.scheme, ap_http_scheme(r))
&& ap_matches_request_vhost(r, r->parsed_uri.hostname,
(apr_port_t)(r->parsed_uri.port_str ? r->parsed_uri.port
: ap_default_port(r))))) {
for (i = 0; i < conf->aliases->nelts; i++) {
len = alias_match(r->unparsed_uri, ent[i].fake);
if (len > 0) {
+ if ((ent[i].real[0] == '!') && (ent[i].real[1] == 0)) {
+ return DECLINED;
+ }
r->filename = apr_pstrcat(r->pool, "proxy:", ent[i].real,
r->unparsed_uri + len, NULL);
r->handler = "proxy-server";
new = apr_array_push(conf->aliases);
new->fake = apr_pstrdup(cmd->pool, f);
new->real = apr_pstrdup(cmd->pool, r);
+ if (r[0] == '!' && r[1] == '\0')
+ return NULL;
arr = apr_table_elts(params);
elts = (const apr_table_entry_t *)arr->elts;
ap_rputs("<hr />\n<h1>Proxy LoadBalancer Status for ", r);
ap_rvputs(r, balancer->name, "</h1>\n\n", NULL);
ap_rputs("\n\n<table border=\"0\"><tr>"
- "<th>SSes</th><th>Timeout</th>"
+ "<th>SSes</th><th>Timeout</th><th>Method</th>"
"</tr>\n<tr>", r);
ap_rvputs(r, "<td>", balancer->sticky, NULL);
- ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>\n",
+ ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
apr_time_sec(balancer->timeout));
+ ap_rprintf(r, "<td>%s</td>\n",
+ balancer->lbmethod == lbmethod_requests ? "Requests" :
+ balancer->lbmethod == lbmethod_traffic ? "Traffic" :
+ "Unknown");
ap_rputs("</table>\n", r);
ap_rputs("\n\n<table border=\"0\"><tr>"
"<th>Sch</th><th>Host</th><th>Stat</th>"
ap_rvputs(r, "</td><td>", worker->s->redirect, NULL);
ap_rprintf(r, "</td><td>%d</td>", worker->s->lbfactor);
ap_rprintf(r, "<td>%d</td><td>", (int)(worker->s->elected));
- ap_rputs(apr_strfsize(worker->s->transfered, fbuf), r);
+ ap_rputs(apr_strfsize(worker->s->transferred, fbuf), r);
ap_rputs("</td><td>", r);
ap_rputs(apr_strfsize(worker->s->read, fbuf), r);
ap_rputs("</td>\n", r);
"<tr><th>Redir</th><td>Session Route Redirection</td></tr>\n"
"<tr><th>F</th><td>Load Balancer Factor in %</td></tr>\n"
"<tr><th>Acc</th><td>Number of requests</td></tr>\n"
- "<tr><th>Wr</th><td>Number of bytes transfered</td></tr>\n"
+ "<tr><th>Wr</th><td>Number of bytes transferred</td></tr>\n"
"<tr><th>Rd</th><td>Number of bytes read</td></tr>\n"
"</table>", r);