]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: config: inform the user only once that "redispatch" is deprecated
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Apr 2014 20:37:32 +0000 (22:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Apr 2014 23:09:40 +0000 (01:09 +0200)
It may go away in 1.6, but there's no point reporting it for each and
every occurrence.

include/types/global.h
src/cfgparse.c

index eff4ed3bed161b8ad0b19bd466af24d1e102c298..82a8e9db520f46c24bf15f40243d3ece31f9ee09 100644 (file)
@@ -175,6 +175,7 @@ extern unsigned int warned;     /* bitfield of a few warnings to emit just once
 /* bit values to go with "warned" above */
 #define WARN_BLOCK_DEPRECATED       0x00000001
 #define WARN_REQSETBE_DEPRECATED    0x00000002
+#define WARN_REDISPATCH_DEPRECATED  0x00000004
 
 /* to be used with warned and WARN_* */
 static inline int already_warned(unsigned int warning)
index 7356408679cbee1d6b4b3402fa0b8148ef627951..6ac3ccccfad73835f03cb8f4a2158c4a583f9f1a 100644 (file)
@@ -4062,7 +4062,8 @@ stats_error_parsing:
                if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
                        err_code |= ERR_WARN;
 
-               Warning("parsing [%s:%d]: keyword '%s' is deprecated, please use 'option redispatch' instead.\n",
+               if (!already_warned(WARN_REDISPATCH_DEPRECATED))
+                       Warning("parsing [%s:%d]: keyword '%s' is deprecated in favor of 'option redispatch', and will not be supported by future versions.\n",
                                file, linenum, args[0]);
                err_code |= ERR_WARN;
                /* enable reconnections to dispatch */