]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] conf: add tcp-request content rules to the correct list
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Aug 2010 11:35:41 +0000 (13:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Aug 2010 11:35:41 +0000 (13:35 +0200)
Due to the change in commit 68c03, the tcp-request content rules were
unfortunately being added to the request rules.

src/proto_tcp.c

index 301666f3c646b229f0f635ee305b666e09bc5ecd..2670666126634f44a02ccd6fca57edb129947674 100644 (file)
@@ -919,6 +919,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
        }
 
        rule = (struct tcp_rule *)calloc(1, sizeof(*rule));
+       LIST_INIT(&rule->list);
        arg = 1;
 
        if (strcmp(args[1], "content") == 0) {
@@ -938,6 +939,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                                          name);
                        warn++;
                }
+               LIST_ADDQ(&curpx->tcp_req.inspect_rules, &rule->list);
        }
        else if (strcmp(args[1], "connection") == 0) {
                arg++;
@@ -971,6 +973,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                                                  name);
                        warn++;
                }
+               LIST_ADDQ(&curpx->tcp_req.l4_rules, &rule->list);
        }
        else {
                retlen = snprintf(err, errlen,
@@ -979,8 +982,6 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                goto error;
        }
 
-       LIST_INIT(&rule->list);
-       LIST_ADDQ(&curpx->tcp_req.l4_rules, &rule->list);
        return warn;
  error:
        free(rule);