]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MAJOR: config: remove the deprecated reqsetbe / reqisetbe actions
authorWilly Tarreau <w@1wt.eu>
Tue, 26 May 2015 10:18:29 +0000 (12:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2015 10:18:29 +0000 (12:18 +0200)
These ones were already obsoleted in 1.4, marked for removal in 1.5,
and not documented anymore. They used to emit warnings, and do still
require quite some code to stay in place. Let's remove them now.

doc/configuration.txt
include/common/regex.h
include/types/global.h
src/cfgparse.c
src/haproxy.c
src/proto_http.c

index a2eac7bb85b944be7b587ec2f50bb348756b1f52..fdb0ddc6514326273102c4a2d2e5e3ad62db527e 100644 (file)
@@ -1608,12 +1608,10 @@ reqidel                                   -          X         X         X
 reqideny                                  -          X         X         X
 reqipass                                  -          X         X         X
 reqirep                                   -          X         X         X
-reqisetbe                                 -          X         X         X
 reqitarpit                                -          X         X         X
 reqpass                                   -          X         X         X
 reqrep                                    -          X         X         X
 -- keyword -------------------------- defaults - frontend - listen -- backend -
-reqsetbe                                  -          X         X         X
 reqtarpit                                 -          X         X         X
 retries                                   X          -         X         X
 rspadd                                    -          X         X         X
@@ -2655,7 +2653,7 @@ default_backend <backend>
         use_backend     static   if  url_css url_img extension_img
         default_backend dynamic
 
-  See also : "use_backend", "reqsetbe", "reqisetbe"
+  See also : "use_backend"
 
 
 description <string>
index 76ed290644c21ab5844422beebd6ecb2aa4d4e3b..30a5e3fc7f771e0e6675046dbdefe2023595aec5 100644 (file)
@@ -60,7 +60,6 @@ struct my_regex {
 #define ACT_DENY       3       /* deny the request */
 #define ACT_PASS       4       /* pass this header without allowing or denying the request */
 #define ACT_TARPIT     5       /* tarpit the connection matching this request */
-#define ACT_SETBE      6       /* switch the backend */
 
 struct hdr_exp {
     struct hdr_exp *next;
index 7533bb026629ad6aca7085f6d167004e1a47bbe1..ec6679d7d0bb1d4cc159f1044628f5f3ae325e5d 100644 (file)
@@ -192,7 +192,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
+/* unassigned : 0x00000002 */
 #define WARN_REDISPATCH_DEPRECATED  0x00000004
 #define WARN_CLITO_DEPRECATED       0x00000008
 #define WARN_SRVTO_DEPRECATED       0x00000010
index 1de7a1f3a0dc178bcb433e4e719f97e362de5d15..cf3c0931b186b8912090ca2b504feb31d1bf8681 100644 (file)
@@ -5645,26 +5645,6 @@ stats_error_parsing:
                if (err_code & ERR_FATAL)
                        goto out;
        }
-       else if (!strcmp(args[0], "reqsetbe")) { /* switch the backend from a regex, respecting case */
-               err_code |= create_cond_regex_rule(file, linenum, curproxy,
-                                                  SMP_OPT_DIR_REQ, ACT_SETBE, 0,
-                                                  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,
-                                                  SMP_OPT_DIR_REQ, ACT_SETBE, REG_ICASE,
-                                                  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) {
                        Alert("parsing [%s:%d] : '%s' expects <search> and <replace> as arguments.\n",
@@ -6621,7 +6601,7 @@ next_line:
  * that it is always guaranteed that a backend pointed to by a frontend is
  * bound to all of its processes. After that, if the target is a "listen"
  * instance, the function recursively descends the target's own targets along
- * default_backend, use_backend rules, and reqsetbe rules. Since the bits are
+ * default_backend and use_backend rules. Since the bits are
  * checked first to ensure that <to> is already bound to all processes of
  * <from>, there is no risk of looping and we ensure to follow the shortest
  * path to the destination.
@@ -6635,7 +6615,6 @@ next_line:
 void propagate_processes(struct proxy *from, struct proxy *to)
 {
        struct switching_rule *rule;
-       struct hdr_exp *exp;
 
        if (to) {
                /* check whether we need to go down */
@@ -6670,14 +6649,6 @@ void propagate_processes(struct proxy *from, struct proxy *to)
                to = rule->be.backend;
                propagate_processes(from, to);
        }
-
-       /* reqsetbe */
-       for (exp = from->req_exp; exp != NULL; exp = exp->next) {
-               if (exp->action != ACT_SETBE)
-                       continue;
-               to = (struct proxy *)exp->replace;
-               propagate_processes(from, to);
-       }
 }
 
 /*
@@ -6973,39 +6944,6 @@ int check_config_validity()
                        }
                }
 
-               /* find the target proxy in setbe */
-               if (curproxy->mode == PR_MODE_HTTP && curproxy->req_exp != NULL) {
-                       /* map jump target for ACT_SETBE in req_rep chain */ 
-                       struct hdr_exp *exp;
-                       for (exp = curproxy->req_exp; exp != NULL; exp = exp->next) {
-                               struct proxy *target;
-
-                               if (exp->action != ACT_SETBE)
-                                       continue;
-
-                               target = proxy_be_by_name(exp->replace);
-                               if (!target) {
-                                       Alert("Proxy '%s': unable to find required setbe: '%s'.\n",
-                                               curproxy->id, exp->replace);
-                                       cfgerr++;
-                               } else if (target == curproxy) {
-                                       Alert("Proxy '%s': loop detected for setbe: '%s'.\n",
-                                               curproxy->id, exp->replace);
-                                       cfgerr++;
-                               } else if (target->mode != PR_MODE_HTTP) {
-                                       Alert("%s %s '%s' (%s:%d) tries to use incompatible %s %s '%s' (%s:%d) in a 'reqsetbe' rule (see 'mode').\n",
-                                             proxy_mode_str(curproxy->mode), proxy_type_str(curproxy), curproxy->id,
-                                             curproxy->conf.file, curproxy->conf.line,
-                                             proxy_mode_str(target->mode), proxy_type_str(target), target->id,
-                                             target->conf.file, target->conf.line);
-                                       cfgerr++;
-                               } else {
-                                       free((void *)exp->replace);
-                                       exp->replace = (const char *)target;
-                               }
-                       }
-               }
-
                /* find the target proxy for 'use_backend' rules */
                list_for_each_entry(rule, &curproxy->switching_rules, list) {
                        struct proxy *target;
@@ -8112,7 +8050,6 @@ out_uri_auth_compat:
                         */
                        for (fe = proxy; fe; fe = fe->next) {
                                struct switching_rule *rule;
-                               struct hdr_exp *exp;
                                int found = 0;
 
                                if (!(fe->cap & PR_CAP_FE))
@@ -8134,15 +8071,6 @@ out_uri_auth_compat:
                                        }
                                }
 
-                               /* check if a "reqsetbe" rule matches */
-                               for (exp = fe->req_exp; !found && exp; exp = exp->next) {
-                                       if (exp->action == ACT_SETBE &&
-                                           (struct proxy *)exp->replace == curproxy) {
-                                               found = 1;
-                                               break;
-                                       }
-                               }
-
                                /* now we've checked all possible ways to reference a backend
                                 * from a frontend.
                                 */
index 353ff8a7a9953112916e925ea9f7a5f7f506d88c..1b774758108730719405fcd325565590ad20b121 100644 (file)
@@ -1220,8 +1220,7 @@ void deinit(void)
                                free(exp->preg);
                        }
 
-                       if (exp->replace && exp->action != ACT_SETBE)
-                               free((char *)exp->replace);
+                       free((char *)exp->replace);
                        expb = exp;
                        exp = exp->next;
                        free(expb);
@@ -1233,8 +1232,7 @@ void deinit(void)
                                free(exp->preg);
                        }
 
-                       if (exp->replace && exp->action != ACT_SETBE)
-                               free((char *)exp->replace);
+                       free((char *)exp->replace);
                        expb = exp;
                        exp = exp->next;
                        free(expb);
index 3d41c562b2f4dfe0d4660ad538ac2810b6416422..e19d4cdd024d17a467d1c8569ece75c56e9bb3b9 100644 (file)
@@ -7127,19 +7127,6 @@ int apply_filter_to_req_headers(struct stream *s, struct channel *req, struct hd
 
                if (regex_exec_match2(exp->preg, cur_ptr, cur_end-cur_ptr, MAX_MATCH, pmatch, 0)) {
                        switch (exp->action) {
-                       case ACT_SETBE:
-                               /* It is not possible to jump a second time.
-                                * FIXME: should we return an HTTP/500 here so that
-                                * the admin knows there's a problem ?
-                                */
-                               if (s->be != strm_fe(s))
-                                       break;
-
-                               /* Swithing Proxy */
-                               stream_set_backend(s, (struct proxy *)exp->replace);
-                               last_hdr = 1;
-                               break;
-
                        case ACT_ALLOW:
                                txn->flags |= TX_CLALLOW;
                                last_hdr = 1;
@@ -7228,19 +7215,6 @@ int apply_filter_to_req_line(struct stream *s, struct channel *req, struct hdr_e
 
        if (regex_exec_match2(exp->preg, cur_ptr, cur_end-cur_ptr, MAX_MATCH, pmatch, 0)) {
                switch (exp->action) {
-               case ACT_SETBE:
-                       /* It is not possible to jump a second time.
-                        * FIXME: should we return an HTTP/500 here so that
-                        * the admin knows there's a problem ?
-                        */
-                       if (s->be != strm_fe(s))
-                               break;
-
-                       /* Swithing Proxy */
-                       stream_set_backend(s, (struct proxy *)exp->replace);
-                       done = 1;
-                       break;
-
                case ACT_ALLOW:
                        txn->flags |= TX_CLALLOW;
                        done = 1;