]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proto_tcp: bidirectional fetches not supported anymore in track-sc1/2
authorWilly Tarreau <w@1wt.eu>
Sun, 9 Dec 2012 16:04:41 +0000 (17:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 Dec 2012 16:04:41 +0000 (17:04 +0100)
Sample fetch capabilities indicate when the fetch may be used and not
what it requires, so we need to check if a fetch is compatible with
the direction we want and not if it works backwards.

src/proto_tcp.c

index 4c4f5a78a4b876485d9463efcfa4b901cba95c3f..5edeeee26d2c9d91e74ae732265e284d119328ee 100644 (file)
@@ -1309,9 +1309,9 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                }
 
                if ((rule->action == TCP_ACT_TRK_SC1 || rule->action == TCP_ACT_TRK_SC2) &&
-                   (rule->act_prm.trk_ctr.expr->fetch->cap & SMP_CAP_RES)) {
+                   !(rule->act_prm.trk_ctr.expr->fetch->cap & SMP_CAP_REQ)) {
                        memprintf(err,
-                                 "fetch '%s' involves some response-only criteria which will be ignored in '%s %s'",
+                                 "fetch '%s' cannot be used on requests and will be ignored in '%s %s'",
                                  rule->act_prm.trk_ctr.expr->fetch->kw, args[0], args[1]);
                        warn++;
                }
@@ -1352,9 +1352,9 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                }
 
                if ((rule->action == TCP_ACT_TRK_SC1 || rule->action == TCP_ACT_TRK_SC2) &&
-                   (rule->act_prm.trk_ctr.expr->fetch->cap & SMP_CAP_RES)) {
+                   !(rule->act_prm.trk_ctr.expr->fetch->cap & SMP_CAP_REQ)) {
                        memprintf(err,
-                                 "fetch '%s' involves some response-only criteria which will be ignored in '%s %s'",
+                                 "fetch '%s' cannot be used on requests and will be ignored in '%s %s'",
                                  rule->act_prm.trk_ctr.expr->fetch->kw, args[0], args[1]);
                        warn++;
                }