]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: action: Don't check http capture rules when no id is defined
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 4 Dec 2017 08:45:15 +0000 (09:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Dec 2017 09:39:56 +0000 (10:39 +0100)
This is a regression in the commit 29730ba5 ("MINOR: action: Add a functions to
check http capture rules"). We must check the capture id only when an id is
defined.

This patch must be backported in 1.8.

src/proto_http.c

index 7dd0daf9dd00b93e79d1f2d8543c366d8d4519ca..f2152d6c1582a49283762b6d1dfc7bd138f781fc 100644 (file)
@@ -12049,6 +12049,9 @@ enum act_return http_action_req_capture_by_id(struct act_rule *rule, struct prox
  */
 int check_http_req_capture(struct act_rule *rule, struct proxy *px, char **err)
 {
+       if (rule->action_ptr != http_action_req_capture_by_id)
+               return 1;
+
        if (rule->arg.capid.idx >= px->nb_req_cap) {
                memprintf(err, "unable to find capture id '%d' referenced by http-request capture rule",
                          rule->arg.capid.idx);
@@ -12235,6 +12238,9 @@ enum act_return http_action_res_capture_by_id(struct act_rule *rule, struct prox
  */
 int check_http_res_capture(struct act_rule *rule, struct proxy *px, char **err)
 {
+       if (rule->action_ptr != http_action_res_capture_by_id)
+               return 1;
+
        if (rule->arg.capid.idx >= px->nb_rsp_cap) {
                memprintf(err, "unable to find capture id '%d' referenced by http-response capture rule",
                          rule->arg.capid.idx);