Skip to content

Commit

Permalink
MEDIUM: config: inform the user only once that "redispatch" is deprec…
Browse files Browse the repository at this point in the history
…ated

It may go away in 1.6, but there's no point reporting it for each and
every occurrence.
  • Loading branch information
wtarreau committed Apr 28, 2014
1 parent 40bac83 commit a3c504c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/types/global.h
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/cfgparse.c
Expand Up @@ -4062,7 +4062,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
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 */
Expand Down

0 comments on commit a3c504c

Please sign in to comment.