On 04/07/2010 03:40 PM, "Plüm, Rüdiger, VF-Group" wrote: > > >> -----Original Message----- >> From: jean-frederic clere [mailto:[email protected]] >> Sent: Mittwoch, 7. April 2010 15:32 >> To: [email protected] >> Subject: Arranging mod_proxy_balancer in trunk >> >> Hi, >> >> In mod_proxy_balancer after >> runtime = find_session_route(*balancer, r, &route, &sticky, url); >> >> There is a logic that belongs to the LB implementation, my >> idea is to add a >> apr_status_t (*updatelbstatus)(proxy_balancer *balancer, proxy_worker >> *elected, server_rec *s); >> in the proxy_balancer_method (mod_proxy.h) and call the LB >> implementation. >> >> Comments? > > You are talking about replacing this > > int i, total_factor = 0; > proxy_worker **workers; > /* We have a sticky load balancer > * Update the workers status > * so that even session routes get > * into account. > */ > workers = (proxy_worker **)(*balancer)->workers->elts; > for (i = 0; i < (*balancer)->workers->nelts; i++) { > /* Take into calculation only the workers that are > * not in error state or not disabled. > * > * TODO: Abstract the below, since this is dependent > * on the LB implementation > */ > if (PROXY_WORKER_IS_USABLE(*workers)) { > (*workers)->s->lbstatus += (*workers)->s->lbfactor; > total_factor += (*workers)->s->lbfactor; > } > workers++; > } > runtime->s->lbstatus -= total_factor; > runtime->s->elected++; > > *worker = runtime; > > > with > > apr_status_t (*updatelbstatus)(proxy_balancer *balancer, proxy_worker > *elected, server_rec *s); > > , correct?
Yes :-) Cheers Jean-Frederic
