const char *url)
{
char *c, *q, *uri = apr_pstrdup(p, url);
- int port;
apr_status_t rc = 0;
c = strchr(uri, ':');
if (c == NULL || c[1] != '/' || c[2] != '/' || c[3] == '\0')
- return "Bad syntax for a remote proxy server";
+ return "Bad syntax for a balancer name";
/* remove path from uri */
if ((q = strchr(c + 3, '/')))
*q = '\0';
- q = strchr(c + 3, ':');
- if (q != NULL) {
- if (sscanf(q + 1, "%u", &port) != 1 || port > 65535) {
- return "Bad syntax for a remote proxy server (bad port number)";
- }
- }
- else
- port = -1;
ap_str_tolower(uri);
*balancer = apr_array_push(conf->balancers);
(*balancer)->name = uri;
workers[i].lbfactor -= median;
}
}
-
+ for (i = 0; i < balancer->workers->nelts; i++) {
+ /* Update the status entires */
+ workers[i].lbstatus = workers[i].lbfactor;
+ }
}
PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
/* Set min to be lower then smax */
if (worker->min > worker->smax)
worker->min = worker->smax;
+ worker->cp->nfree = worker->hmax;
}
else {
/* This will supress the apr_reslist creation */