git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2481
d4fa192b-c00b-0410-8231-
f00ffab90ce4
#define VDI_RANDOM_MAGIC 0x476d25b7
struct director dir;
struct backend *backend;
- unsigned nhosts;
struct vdi_random_host *hosts;
};
vh = vs->hosts;
te = t->members;
for (i = 0; i < t->nmember; i++, vh++, te++) {
+ assert(te->weight > 0.0);
s += te->weight;
vh->backend = VBE_AddBackend(cli, te->host);
}
/* Normalize weights */
i = 0;
a = 0.0;
+ assert(s > 0.0);
for (te = t->members; te->host != NULL; te++, i++) {
/* First normalize the specified weight in FP */
b = te->weight / s;