]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: config: inform the user that "reqsetbe" is deprecated
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Apr 2014 20:37:06 +0000 (22:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Apr 2014 22:46:01 +0000 (00:46 +0200)
It will go away in 1.6.

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

index 967d3b472ed2d5565afa0ad9246c6af0a04b5239..eff4ed3bed161b8ad0b19bd466af24d1e102c298 100644 (file)
@@ -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)
index 485205945fb7ae9780a7b1429e164acedc2510d6..7356408679cbee1d6b4b3402fa0b8148ef627951 100644 (file)
@@ -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) {