3
unsigned BackendDef::min_wt;
4
unsigned BackendDef::max_wt;
5
bool BackendDef::minmax_wt_set = false;
7
BackendDef::BackendDef (string server, string port,
8
string maxclients, string w) :
9
srv(server), prt(-1), max(0), host_match(""), url_match(""),
10
wt(1), backend_check() {
12
if (sscanf (port.c_str(), "%d", &prt) < 1)
13
throw Error("Bad backend port specifier: '" + port +
15
if (maxclients.size() &&
16
sscanf (maxclients.c_str(), "%u", &max) < 1)
17
throw Error("Bad maximum connections specifier: '" +
18
maxclients + "' is not a number");
21
if (sscanf(w.c_str(), "%u", &ww) < 1)
22
throw Error("Bad backend weight specifier: '" + w +
25
throw Error("Weights less than 1 are not supported");