[MINOR] add a weight divisor to the struct proxy
Under some circumstances, it will be useful to be able to have
a server's effective weight bigger than the user weight, and this
is particularly true for dynamic weight-based algorithms. In order
to support this, we add a "wdiv" member to the lbprm structure
which will always be used to divide the weights before reporting
them.
diff --git a/include/proto/backend.h b/include/proto/backend.h
index 7414ede..8fa8c83 100644
--- a/include/proto/backend.h
+++ b/include/proto/backend.h
@@ -42,6 +42,7 @@
void recount_servers(struct proxy *px);
void recalc_server_map(struct proxy *px);
int be_downtime(struct proxy *px);
+void init_server_map(struct proxy *p);
/*
* This function tries to find a running server with free connection slots for
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 03f9601..53de513 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -86,6 +86,7 @@
int tot_weight; /* total effective weight of servers participating to LB */
int tot_used; /* total number of servers used for LB */
int wmult; /* ratio between user weight and effective weight */
+ int wdiv; /* ratio between effective weight and user weight */
struct {
struct server **srv; /* the server map used to apply weights */
int rr_idx; /* next server to be elected in round robin mode */