From 0c185fbd2a3d4c0ad5851cf696cd6782b6981c19 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 21 Feb 2015 09:58:36 +1100 Subject: [PATCH] Max sure max headroom variable is 64 bit --- src/stratifier.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {