From 55bc0f8eb7a48a8f482f1e74eb2bf29b18e0ce99 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 15 Mar 2009 14:51:53 +0100 Subject: [PATCH] [MEDIUM] reverse internal proxy declaration order to match configuration People are regularly complaining that proxies are linked in reverse order when reading the stats. This is now definitely fixed because the proxy order is now fixed to match configuration order. --- src/cfgparse.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cfgparse.c b/src/cfgparse.c index 1158988ff..c3344738a 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3096,6 +3096,19 @@ int readcfgfile(const char *file) /* will be needed further to delay some tasks */ tv_update_date(0,1); + /* first, we will invert the proxy list order */ + curproxy = NULL; + while (proxy) { + struct proxy *next; + + next = proxy->next; + proxy->next = curproxy; + curproxy = proxy; + if (!next) + break; + proxy = next; + } + if ((curproxy = proxy) == NULL) { Alert("parsing %s : no line. Nothing to do !\n", file);