From: Willy Tarreau Date: Mon, 28 Apr 2014 20:37:06 +0000 (+0200) Subject: MEDIUM: config: inform the user that "reqsetbe" is deprecated X-Git-Tag: v1.5-dev25~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40bac83734afb415553f4ee5f38db08c6cb6b4a7;p=thirdparty%2Fhaproxy.git MEDIUM: config: inform the user that "reqsetbe" is deprecated It will go away in 1.6. --- diff --git a/include/types/global.h b/include/types/global.h index 967d3b472e..eff4ed3bed 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -174,6 +174,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 /* 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 485205945f..7356408679 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4997,6 +4997,9 @@ stats_error_parsing: args[0], args[1], args[2], (const char **)args+3); if (err_code & ERR_FATAL) goto out; + + if (!already_warned(WARN_REQSETBE_DEPRECATED)) + Warning("parsing [%s:%d] : The '%s' directive is now deprecated in favor of the more efficient 'use_backend' which uses a different but more powerful syntax. Future versions will not support '%s' anymore, you should convert it now!\n", file, linenum, args[0], args[0]); } else if (!strcmp(args[0], "reqisetbe")) { /* switch the backend from a regex, ignoring case */ err_code |= create_cond_regex_rule(file, linenum, curproxy, @@ -5004,6 +5007,9 @@ stats_error_parsing: args[0], args[1], args[2], (const char **)args+3); if (err_code & ERR_FATAL) goto out; + + if (!already_warned(WARN_REQSETBE_DEPRECATED)) + Warning("parsing [%s:%d] : The '%s' directive is now deprecated in favor of the more efficient 'use_backend' which uses a different but more powerful syntax. Future versions will not support '%s' anymore, you should convert it now!\n", file, linenum, args[0], args[0]); } else if (!strcmp(args[0], "reqirep")) { /* replace request header from a regex, ignoring case */ if (*(args[2]) == 0) {