diff --git a/src/stratifier.c b/src/stratifier.c index 29944db5..be6c49f5 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2456,10 +2456,10 @@ static sdata_t *select_sdata(const ckpool_t *ckp, sdata_t *ckp_sdata) mutex_lock(&ckp_sdata->proxy_lock); HASH_ITER(hh, ckp_sdata->proxies, proxy, tmp) { - int most_headroom; + int64_t max_headroom; best = NULL; - proxy->headroom = most_headroom = 0; + proxy->headroom = max_headroom = 0; HASH_ITER(sh, proxy->subproxies, subproxy, tmpsub) { int64_t subproxy_headroom; @@ -2470,9 +2470,9 @@ static sdata_t *select_sdata(const ckpool_t *ckp, sdata_t *ckp_sdata) subproxy_headroom = subproxy->max_clients - subproxy->clients; proxy->headroom += subproxy_headroom; - if (subproxy_headroom > most_headroom) { + if (subproxy_headroom > max_headroom) { best = subproxy; - most_headroom = subproxy_headroom; + max_headroom = subproxy_headroom; } } if (best && best->id < best_id) {