From: Willy Tarreau Date: Mon, 28 Apr 2014 20:37:32 +0000 (+0200) Subject: MEDIUM: config: inform the user only once that "redispatch" is deprecated X-Git-Tag: v1.5-dev25~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3c504c032614ee65af434e41c08ebe46855ebd8;p=thirdparty%2Fhaproxy.git MEDIUM: config: inform the user only once that "redispatch" is deprecated It may go away in 1.6, but there's no point reporting it for each and every occurrence. --- diff --git a/include/types/global.h b/include/types/global.h index eff4ed3bed..82a8e9db52 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -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) diff --git a/src/cfgparse.c b/src/cfgparse.c index 7356408679..6ac3ccccfa 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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 */