]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR/CLEANUP: proxy: rename "proxy" to "proxies_list"
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 24 Nov 2017 15:54:05 +0000 (16:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Nov 2017 16:21:27 +0000 (17:21 +0100)
Rename the global variable "proxy" to "proxies_list".
There's been multiple proxies in haproxy for quite some time, and "proxy"
is a potential source of bugs, a number of functions have a "proxy" argument,
and some code used "proxy" when it really meant "px" or "curproxy". It worked
by pure luck, because it usually happened while parsing the config, and thus
"proxy" pointed to the currently parsed proxy, but we should probably not
rely on this.

[wt: some of these are definitely fixes that are worth backporting]

16 files changed:
include/proto/proxy.h
src/cache.c
src/cfgparse.c
src/checks.c
src/cli.c
src/dns.c
src/filters.c
src/flt_spoe.c
src/haproxy.c
src/hlua_fcn.c
src/proto_http.c
src/proto_tcp.c
src/proxy.c
src/server.c
src/stats.c
src/stick_table.c

index cb86159a9bf343ee78b8db21d1be35f2a198031a..d4a34a54f1635b1d9bfcab033e2d214064c50a32 100644 (file)
@@ -31,7 +31,7 @@
 #include <types/listener.h>
 #include <proto/freq_ctr.h>
 
-extern struct proxy *proxy;
+extern struct proxy *proxies_list;
 extern struct eb_root used_proxy_id;   /* list of proxy IDs in use */
 extern unsigned int error_snapshot_id;  /* global ID assigned to each error then incremented */
 extern struct eb_root proxy_by_name;    /* tree of proxies sorted by name */
index 97861d761c20ab6c6710a8653d317e150c800e42..ae345a1610349473bff3d9731b8107d33a60f432 100644 (file)
@@ -840,7 +840,7 @@ int cfg_cache_postparser()
        int err = 0;
        struct flt_conf *fconf;
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
 
                /* resolve the http response cache name to a ptr in the action rule */
                list_for_each_entry(hresrule, &curproxy->http_res_rules, list) {
index 685fbe9b050d2f2eb2abfa95a331d6726e3d85f0..f66f4163e2c88094a4df2b14df361eddeb9d94e0 100644 (file)
@@ -2747,8 +2747,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                }
 
                init_new_proxy(curproxy);
-               curproxy->next = proxy;
-               proxy = curproxy;
+               curproxy->next = proxies_list;
+               proxies_list = curproxy;
                curproxy->conf.args.file = curproxy->conf.file = strdup(file);
                curproxy->conf.args.line = curproxy->conf.line = linenum;
                curproxy->last_change = now.tv_sec;
@@ -7546,18 +7546,18 @@ int check_config_validity()
 
        /* first, we will invert the proxy list order */
        curproxy = NULL;
-       while (proxy) {
+       while (proxies_list) {
                struct proxy *next;
 
-               next = proxy->next;
-               proxy->next = curproxy;
-               curproxy = proxy;
+               next = proxies_list->next;
+               proxies_list->next = curproxy;
+               curproxy = proxies_list;
                if (!next)
                        break;
-               proxy = next;
+               proxies_list = next;
        }
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                struct switching_rule *rule;
                struct server_rule *srule;
                struct sticking_rule *mrule;
@@ -8819,7 +8819,7 @@ out_uri_auth_compat:
        }
 
        /* Make each frontend inherit bind-process from its listeners when not specified. */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->bind_proc)
                        continue;
 
@@ -8849,14 +8849,14 @@ out_uri_auth_compat:
         * are any fatal errors as we must not call it with unresolved proxies.
         */
        if (!cfgerr) {
-               for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+               for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                        if (curproxy->cap & PR_CAP_FE)
                                propagate_processes(curproxy, NULL);
                }
        }
 
        /* Bind each unbound backend to all processes when not specified. */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->bind_proc)
                        continue;
                curproxy->bind_proc = nbits(global.nbproc);
@@ -8868,7 +8868,7 @@ out_uri_auth_compat:
 
        /* perform the final checks before creating tasks */
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                struct listener *listener;
                unsigned int next_id;
 
@@ -9000,7 +9000,7 @@ out_uri_auth_compat:
        /* automatically compute fullconn if not set. We must not do it in the
         * loop above because cross-references are not yet fully resolved.
         */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                /* If <fullconn> is not set, let's set it to 10% of the sum of
                 * the possible incoming frontend's maxconns.
                 */
@@ -9019,7 +9019,7 @@ out_uri_auth_compat:
         * Recount currently required checks.
         */
 
-       for (curproxy=proxy; curproxy; curproxy=curproxy->next) {
+       for (curproxy=proxies_list; curproxy; curproxy=curproxy->next) {
                int optnum;
 
                for (optnum = 0; cfg_opts[optnum].name; optnum++)
@@ -9032,7 +9032,7 @@ out_uri_auth_compat:
        }
 
        /* compute the required process bindings for the peers */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next)
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next)
                if (curproxy->table.peers.p)
                        curproxy->table.peers.p->peers_fe->bind_proc |= curproxy->bind_proc;
 
@@ -9099,7 +9099,7 @@ out_uri_auth_compat:
         * be done earlier because the data size may be discovered while parsing
         * other proxies.
         */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->state == PR_STSTOPPED)
                        continue;
 
@@ -9147,7 +9147,7 @@ out_uri_auth_compat:
 
        /* Update server_state_file_name to backend name if backend is supposed to use
         * a server-state file locally defined and none has been provided */
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
                if (curproxy->load_server_state_from_file == PR_SRV_STATE_FILE_LOCAL &&
                    curproxy->server_state_file_name == NULL)
                        curproxy->server_state_file_name = strdup(curproxy->id);
index dc970e003467a4bb14345af62abf2f996fc34abd..4aef54e73af8f025d1662fc7456b94eb5ab1a870 100644 (file)
@@ -2332,7 +2332,7 @@ static int start_checks()
         * a shorter interval will start independently and will not dictate
         * too short an interval for all others.
         */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                for (s = px->srv; s; s = s->next) {
                        if (s->slowstart) {
                                if ((t = task_new(MAX_THREADS_MASK)) == NULL) {
@@ -2376,7 +2376,7 @@ static int start_checks()
         * start them after their interval set to the min interval divided by
         * the number of servers, weighted by the server's position in the list.
         */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if ((px->options2 & PR_O2_CHK_ANY) == PR_O2_EXT_CHK) {
                        if (init_pid_list()) {
                                ha_alert("Starting [%s] check: out of memory.\n", px->id);
index 3d88780fb8282550d57b44290564dff54282bc16..149ecd7c8b2e7a1460b02f51476f2ff42f1f9e0d 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -170,8 +170,8 @@ static struct proxy *alloc_stats_fe(const char *name, const char *file, int line
                return NULL;
 
        init_new_proxy(fe);
-       fe->next = proxy;
-       proxy = fe;
+       fe->next = proxies_list;
+       proxies_list = fe;
        fe->last_change = now.tv_sec;
        fe->id = strdup("GLOBAL");
        fe->cap = PR_CAP_FE;
@@ -1276,7 +1276,7 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
         * First, calculates the total number of FD, so that we can let
         * the caller know how much he should expects.
         */
-       px = proxy;
+       px = proxies_list;
        while (px) {
                struct listener *l;
 
@@ -1313,7 +1313,7 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
        cmsg->cmsg_type = SCM_RIGHTS;
        tmpfd = (int *)CMSG_DATA(cmsg);
 
-       px = proxy;
+       px = proxies_list;
        /* For each socket, e message is sent, containing the following :
         *  Size of the namespace name (or 0 if none), as an unsigned char.
         *  The namespace name, if any
index a83c8aaab1eeb0581f014c5f9a11e9447184435c..8db8290ff18ad7feb3892941802dd31f0d14cf58 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -1897,7 +1897,7 @@ static int dns_finalize_config(void)
                task_wakeup(t, TASK_WOKEN_INIT);
        }
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                struct server *srv;
 
                for (srv = px->srv; srv; srv = srv->next) {
index bf188b5420e5f9440159743f7292d8c6e86ad1e9..e9982caecb4473ea5d543d12d9c9978725e0b507 100644 (file)
@@ -288,7 +288,7 @@ flt_init_all()
        struct proxy *px;
        int err_code = 0;
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                err_code |= flt_init(px);
                if (err_code & (ERR_ABORT|ERR_FATAL)) {
                        ha_alert("Failed to initialize filters for proxy '%s'.\n",
@@ -307,7 +307,7 @@ flt_init_all_per_thread()
        struct proxy *px;
        int err_code = 0;
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                err_code = flt_init_per_thread(px);
                if (err_code & (ERR_ABORT|ERR_FATAL)) {
                        ha_alert("Failed to initialize filters for proxy '%s' for thread %u.\n",
@@ -376,7 +376,7 @@ flt_deinit_all_per_thread()
 {
        struct proxy *px;
 
-       for (px = proxy; px; px = px->next)
+       for (px = proxies_list; px; px = px->next)
                flt_deinit_per_thread(px);
 }
 
index 717715a8e03cdf78dbc2844986a02d486bbdbd73..b653109e3ded8e705d55a35dc93ea931c6b8872d 100644 (file)
@@ -2796,7 +2796,7 @@ spoe_sig_stop(struct sig_handler *sh)
 {
        struct proxy *p;
 
-       p = proxy;
+       p = proxies_list;
        while (p) {
                struct flt_conf *fconf;
 
index 18d2cbf3ae53769d7a98721ec545652623ef548f..219a8eaf6abc363c8d0615fe6c22b0009fb6d5a0 100644 (file)
@@ -555,7 +555,7 @@ static void mworker_cleanlisteners()
        struct listener *l, *l_next;
        struct proxy *curproxy;
 
-       for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
 
                list_for_each_entry_safe(l, l_next, &curproxy->conf.listeners, by_fe) {
                        /* does not close if the FD is inherited with fd@
@@ -821,7 +821,7 @@ static void sig_listen(struct sig_handler *sh)
  */
 static void sig_dump_state(struct sig_handler *sh)
 {
-       struct proxy *p = proxy;
+       struct proxy *p = proxies_list;
 
        ha_warning("SIGHUP received, dumping servers states.\n");
        while (p) {
@@ -1540,7 +1540,7 @@ static void init(int argc, char **argv)
        /* Apply server states */
        apply_server_state();
 
-       for (px = proxy; px; px = px->next)
+       for (px = proxies_list; px; px = px->next)
                srv_compute_all_admin_states(px);
 
        /* Apply servers' configured address */
@@ -1558,7 +1558,7 @@ static void init(int argc, char **argv)
                        if (pr->peers_fe)
                                break;
 
-               for (px = proxy; px; px = px->next)
+               for (px = proxies_list; px; px = px->next)
                        if (px->state == PR_STNEW && !LIST_ISEMPTY(&px->conf.listeners))
                                break;
 
@@ -1745,7 +1745,7 @@ static void init(int argc, char **argv)
                struct proxy *cur;
                int nbfe = 0, nbbe = 0;
 
-               for (cur = proxy; cur; cur = cur->next) {
+               for (cur = proxies_list; cur; cur = cur->next) {
                        if (cur->options2 & (PR_O2_SPLIC_ANY)) {
                                if (cur->cap & PR_CAP_FE)
                                        nbfe += cur->maxconn;
@@ -1926,7 +1926,7 @@ static void deinit_stick_rules(struct list *rules)
 
 void deinit(void)
 {
-       struct proxy *p = proxy, *p0;
+       struct proxy *p = proxies_list, *p0;
        struct cap_hdr *h,*h_next;
        struct server *s,*s_next;
        struct listener *l,*l_next;
@@ -2823,7 +2823,7 @@ int main(int argc, char **argv)
                }
 
                /* we might have to unbind some proxies from some processes */
-               px = proxy;
+               px = proxies_list;
                while (px != NULL) {
                        if (px->bind_proc && px->state != PR_STSTOPPED) {
                                if (!(px->bind_proc & (1UL << proc))) {
index 54fbfa79ac3af76e14d254ad55afe259c03d5aec..a8d53d45b7d1ede813b17d8b77e34feb3be05e33 100644 (file)
@@ -943,7 +943,7 @@ int hlua_fcn_post_init(lua_State *L)
        lua_newtable(L);
 
        /* List all proxies. */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                lua_pushstring(L, px->id);
                hlua_fcn_new_proxy(L, px);
                lua_settable(L, -3);
@@ -957,7 +957,7 @@ int hlua_fcn_post_init(lua_State *L)
        lua_newtable(L);
 
        /* List all proxies. */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (!(px->cap & PR_CAP_FE))
                        continue;
                lua_pushstring(L, px->id);
@@ -973,7 +973,7 @@ int hlua_fcn_post_init(lua_State *L)
        lua_newtable(L);
 
        /* List all proxies. */
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (!(px->cap & PR_CAP_BE))
                        continue;
                lua_pushstring(L, px->id);
index 21e30cc9db55339f380c8ed8c0f4cb3e45459957..88a2de920d66adb2b3ce6914c20d8d1ea694a1fa 100644 (file)
@@ -9184,7 +9184,7 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st
                }
                else if (strcmp(args[cur_arg], "if") == 0 ||
                         strcmp(args[cur_arg], "unless") == 0) {
-                       cond = build_acl_cond(file, linenum, &proxy->acl, curproxy, (const char **)args + cur_arg, errmsg);
+                       cond = build_acl_cond(file, linenum, &curproxy->acl, curproxy, (const char **)args + cur_arg, errmsg);
                        if (!cond) {
                                memprintf(errmsg, "error in condition: %s", *errmsg);
                                return NULL;
@@ -11873,9 +11873,9 @@ enum act_parse_ret parse_set_req_line(const char **args, int *orig_arg, struct p
        }
 
        LIST_INIT(&rule->arg.http.logfmt);
-       proxy->conf.args.ctx = ARGC_HRQ;
-       if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.http.logfmt, LOG_OPT_HTTP,
-                                   (proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, err)) {
+       px->conf.args.ctx = ARGC_HRQ;
+       if (!parse_logformat_string(args[cur_arg], px, &rule->arg.http.logfmt, LOG_OPT_HTTP,
+                                   (px->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, err)) {
                return ACT_RET_PRS_ERR;
        }
 
@@ -12102,7 +12102,7 @@ enum act_parse_ret parse_http_req_capture(const char **args, int *orig_arg, stru
                        return ACT_RET_PRS_ERR;
                }
 
-               proxy->conf.args.ctx = ARGC_CAP;
+               px->conf.args.ctx = ARGC_CAP;
 
                if (!args[cur_arg]) {
                        memprintf(err, "missing length value");
@@ -12162,7 +12162,7 @@ enum act_parse_ret parse_http_req_capture(const char **args, int *orig_arg, stru
                }
                cur_arg++;
 
-               proxy->conf.args.ctx = ARGC_CAP;
+               px->conf.args.ctx = ARGC_CAP;
 
                rule->action       = ACT_CUSTOM;
                rule->action_ptr   = http_action_req_capture_by_id;
@@ -12302,7 +12302,7 @@ enum act_parse_ret parse_http_res_capture(const char **args, int *orig_arg, stru
        }
        cur_arg++;
 
-       proxy->conf.args.ctx = ARGC_CAP;
+       px->conf.args.ctx = ARGC_CAP;
 
        rule->action       = ACT_CUSTOM;
        rule->action_ptr   = http_action_res_capture_by_id;
@@ -12399,7 +12399,7 @@ static int cli_io_handler_show_errors(struct appctx *appctx)
                        return 0;
                }
 
-               appctx->ctx.errors.px = proxy;
+               appctx->ctx.errors.px = proxies_list;
                appctx->ctx.errors.bol = 0;
                appctx->ctx.errors.ptr = -1;
        }
index 1f9c3f13b224acb5f3363c70fdc61bd918c7d78b..857ebe133cd276a1558acdcb1b4601ec412131f2 100644 (file)
@@ -1398,9 +1398,9 @@ enum act_parse_ret tcp_parse_set_src_dst(const char **args, int *orig_arg, struc
                return ACT_RET_PRS_ERR;
 
        where = 0;
-       if (proxy->cap & PR_CAP_FE)
+       if (px->cap & PR_CAP_FE)
                where |= SMP_VAL_FE_HRQ_HDR;
-       if (proxy->cap & PR_CAP_BE)
+       if (px->cap & PR_CAP_BE)
                where |= SMP_VAL_BE_HRQ_HDR;
 
        if (!(expr->fetch->val & where)) {
index 1730ba4fb175e6a06a576dd47ea58ea67f41e3cc..8500bcc7d7c9773a8924a37b4c9f8524ae1d1780 100644 (file)
@@ -54,7 +54,7 @@
 
 
 int listeners; /* # of proxy listeners, set by cfgparse */
-struct proxy *proxy  = NULL;   /* list of all existing proxies */
+struct proxy *proxies_list  = NULL;    /* list of all existing proxies */
 struct eb_root used_proxy_id = EB_ROOT;        /* list of proxy IDs in use */
 struct eb_root proxy_by_name = EB_ROOT; /* tree of proxies sorted by name */
 unsigned int error_snapshot_id = 0;     /* global ID assigned to each error then incremented */
@@ -783,7 +783,7 @@ int start_proxies(int verbose)
        int pxerr;
        char msg[100];
 
-       for (curproxy = proxy; curproxy != NULL; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy != NULL; curproxy = curproxy->next) {
                if (curproxy->state != PR_STNEW)
                        continue; /* already initialized */
 
@@ -949,7 +949,7 @@ struct task *hard_stop(struct task *t)
 
        ha_warning("soft-stop running for too long, performing a hard-stop.\n");
        send_log(NULL, LOG_WARNING, "soft-stop running for too long, performing a hard-stop.\n");
-       p = proxy;
+       p = proxies_list;
        while (p) {
                if ((p->cap & PR_CAP_FE) && (p->feconn > 0)) {
                        ha_warning("Proxy %s hard-stopped (%d remaining conns will be closed).\n",
@@ -990,7 +990,7 @@ void soft_stop(void)
                        ha_alert("out of memory trying to allocate the hard-stop task.\n");
                }
        }
-       p = proxy;
+       p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
                /* Zombie proxy, let's close the file descriptors */
@@ -1186,7 +1186,7 @@ void pause_proxies(void)
        struct peers *prs;
 
        err = 0;
-       p = proxy;
+       p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
                err |= !pause_proxy(p);
@@ -1220,7 +1220,7 @@ void resume_proxies(void)
        struct peers *prs;
 
        err = 0;
-       p = proxy;
+       p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
                err |= !resume_proxy(p);
@@ -1482,14 +1482,13 @@ static int dump_servers_state(struct stream_interface *si, struct chunk *buf)
 static int cli_io_handler_servers_state(struct appctx *appctx)
 {
        struct stream_interface *si = appctx->owner;
-       extern struct proxy *proxy;
        struct proxy *curproxy;
 
        chunk_reset(&trash);
 
        if (appctx->st2 == STAT_ST_INIT) {
                if (!appctx->ctx.cli.p0)
-                       appctx->ctx.cli.p0 = proxy;
+                       appctx->ctx.cli.p0 = proxies_list;
                appctx->st2 = STAT_ST_HEAD;
        }
 
@@ -1523,7 +1522,6 @@ static int cli_io_handler_servers_state(struct appctx *appctx)
  */
 static int cli_io_handler_show_backend(struct appctx *appctx)
 {
-       extern struct proxy *proxy;
        struct stream_interface *si = appctx->owner;
        struct proxy *curproxy;
 
@@ -1535,7 +1533,7 @@ static int cli_io_handler_show_backend(struct appctx *appctx)
                        si_applet_cant_put(si);
                        return 0;
                }
-               appctx->ctx.cli.p0 = proxy;
+               appctx->ctx.cli.p0 = proxies_list;
        }
 
        for (; appctx->ctx.cli.p0 != NULL; appctx->ctx.cli.p0 = curproxy->next) {
index 62fc59e857720c85a29fbfb4b9bdf28f5237b7b7..9b4d66f941024d857549a71496ca7e1ebcec634e 100644 (file)
@@ -2953,7 +2953,6 @@ void apply_server_state(void)
        char globalfilepath[MAXPATHLEN + 1];
        char localfilepath[MAXPATHLEN + 1];
        int len, fileopenerr, globalfilepathlen, localfilepathlen;
-       extern struct proxy *proxy;
        struct proxy *curproxy, *bk;
        struct server *srv;
 
@@ -3006,7 +3005,7 @@ void apply_server_state(void)
                globalfilepath[0] = '\0';
 
        /* read servers state from local file */
-       for (curproxy = proxy; curproxy != NULL; curproxy = curproxy->next) {
+       for (curproxy = proxies_list; curproxy != NULL; curproxy = curproxy->next) {
                /* servers are only in backends */
                if (!(curproxy->cap & PR_CAP_BE))
                        continue;
@@ -3932,7 +3931,7 @@ int srv_init_addr(void)
        struct proxy *curproxy;
        int return_code = 0;
 
-       curproxy = proxy;
+       curproxy = proxies_list;
        while (curproxy) {
                struct server *srv;
 
index 6cef1bfc774f725d09532dcb93817d55e4ea0567..01259282d0fe424723d7b6ec125eeda304d6b68d 100644 (file)
@@ -2550,7 +2550,7 @@ static int stats_dump_stat_to_buffer(struct stream_interface *si, struct uri_aut
                        }
                }
 
-               appctx->ctx.stats.px = proxy;
+               appctx->ctx.stats.px = proxies_list;
                appctx->ctx.stats.px_st = STAT_PX_ST_INIT;
                appctx->st2 = STAT_ST_LIST;
                /* fall through */
@@ -3537,7 +3537,7 @@ static int cli_parse_clear_counters(char **args, struct appctx *appctx, void *pr
            (clrall && !cli_has_level(appctx, ACCESS_LVL_ADMIN)))
                return 1;
 
-       for (px = proxy; px; px = px->next) {
+       for (px = proxies_list; px; px = px->next) {
                if (clrall) {
                        memset(&px->be_counters, 0, sizeof(px->be_counters));
                        memset(&px->fe_counters, 0, sizeof(px->fe_counters));
index 635114325d9e883f6edaf80246a875ea773fd09f..bd0c8280f87c879cea521850999c50e362c408e2 100644 (file)
@@ -3134,7 +3134,7 @@ static int cli_io_handler_table(struct appctx *appctx)
                case STAT_ST_INIT:
                        appctx->ctx.table.proxy = appctx->ctx.table.target;
                        if (!appctx->ctx.table.proxy)
-                               appctx->ctx.table.proxy = proxy;
+                               appctx->ctx.table.proxy = proxies_list;
 
                        appctx->ctx.table.entry = NULL;
                        appctx->st2 = STAT_ST_INFO;