Browse Source

Max sure max headroom variable is 64 bit

master
Con Kolivas 10 years ago
parent
commit
0c185fbd2a
  1. 8
      src/stratifier.c

8
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) {

Loading…
Cancel
Save