proxy_balancer_method *provider;
provider = ap_lookup_provider(PROXY_LBMETHOD, val, "0");
if (provider) {
- balancer->lbmethod = provider;
+ balancer->s->lbmethod = provider;
return NULL;
}
return "unknown lbmethod";
ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
apr_time_sec(balancer->s->timeout));
ap_rprintf(r, "<td>%s</td>\n",
- balancer->lbmethod->name);
+ balancer->s->lbmethod->name);
ap_rputs("</table>\n", r);
ap_rputs("\n\n<table border=\"0\"><tr>"
"<th>Sch</th><th>Host</th><th>Stat</th>"
char nonce[APR_UUID_FORMATTED_LENGTH + 1];
apr_interval_time_t timeout; /* Timeout for waiting on free connection */
apr_time_t updated; /* timestamp of last update */
+ proxy_balancer_method *lbmethod;
int max_attempts; /* Number of attempts before failing */
int index; /* shm array index */
int sticky_force:1; /* Disable failover for sticky sessions */
apr_array_header_t *workers; /* initially configured workers */
apr_array_header_t *errstatuses; /* statuses to force members into error */
ap_slotmem_instance_t *slot; /* worker shm data - runtime */
- proxy_balancer_method *lbmethod;
int growth; /* number of post-config workers can added */
int max_workers; /* maximum number of allowed workers */
const char *name; /* name of the load balancer */
return NULL;
}
- candidate = (*balancer->lbmethod->finder)(balancer, r);
+ candidate = (*balancer->s->lbmethod->finder)(balancer, r);
if (candidate)
candidate->s->elected++;
/* Step 4: find the session route */
runtime = find_session_route(*balancer, r, &route, &sticky, url);
if (runtime) {
- if ((*balancer)->lbmethod && (*balancer)->lbmethod->updatelbstatus) {
+ if ((*balancer)->s->lbmethod && (*balancer)->s->lbmethod->updatelbstatus) {
/* Call the LB implementation */
- (*balancer)->lbmethod->updatelbstatus(*balancer, runtime, r->server);
+ (*balancer)->s->lbmethod->updatelbstatus(*balancer, runtime, r->server);
}
else { /* Use the default one */
int i, total_factor = 0;
apr_time_sec(balancer->s->timeout));
ap_rprintf(r, "<td align=\"center\">%d</td>\n", balancer->s->max_attempts);
ap_rprintf(r, "<td align=\"center\">%s</td>\n",
- balancer->lbmethod->name);
+ balancer->s->lbmethod->name);
ap_rputs("</table>\n<br />", r);
ap_rputs("\n\n<table border=\"0\" style=\"text-align: left;\"><tr>"
"<th>Worker URL</th>"
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, 0, s, "slotmem_attach failed");
exit(1); /* Ugly, but what else? */
}
- if (balancer->lbmethod && balancer->lbmethod->reset)
- balancer->lbmethod->reset(balancer, s);
+ if (balancer->s->lbmethod && balancer->s->lbmethod->reset)
+ balancer->s->lbmethod->reset(balancer, s);
init_balancer_members(conf, s, balancer);
balancer++;
}