]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: Save last evaluated rule on invalid yield
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Oct 2024 17:15:20 +0000 (18:15 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 31 Oct 2024 08:30:52 +0000 (09:30 +0100)
When an action yields while it is not allowed, an internal error is
reported. This interrupts the processing. So info about the last evaluated
rule must be filled.

This patch may be bakcported if needed. If so, the commit ("MINOR: stream:
Save last evaluated rule on invalid yield") must be backported first.

src/http_ana.c
src/tcp_rules.c

index af365ac229c418039f902c0418db8453cc28d7c7..ab9124d792cc3a8d16ecb55d1f495dac4e0b07c0 100644 (file)
@@ -2748,6 +2748,8 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
                                                send_log(s->be, LOG_WARNING,
                                                         "Internal error: action yields while it is  no long allowed "
                                                         "for the http-request actions.");
+                                               s->last_rule_file = rule->conf.file;
+                                               s->last_rule_line = rule->conf.line;
                                                rule_ret = HTTP_RULE_RES_ERROR;
                                                goto end;
                                        }
@@ -2920,6 +2922,8 @@ resume_execution:
                                                send_log(s->be, LOG_WARNING,
                                                         "Internal error: action yields while it is no long allowed "
                                                         "for the http-response/http-after-response actions.");
+                                               s->last_rule_file = rule->conf.file;
+                                               s->last_rule_line = rule->conf.line;
                                                rule_ret = HTTP_RULE_RES_ERROR;
                                                goto end;
                                        }
index 9ce6c903744d7a941436f7d99b07ff3c6c723d31..2613056f7dd7d976111349368ff3090264184242 100644 (file)
@@ -175,6 +175,8 @@ resume_execution:
                                                        send_log(s->be, LOG_WARNING,
                                                                 "Internal error: yield not allowed if the inspect-delay expired "
                                                                 "for the tcp-request content actions.");
+                                                       s->last_rule_file = rule->conf.file;
+                                                       s->last_rule_line = rule->conf.line;
                                                        goto internal;
                                                }
                                                goto missing_data;
@@ -357,6 +359,8 @@ resume_execution:
                                                        send_log(s->be, LOG_WARNING,
                                                                 "Internal error: yield not allowed if the inspect-delay expired "
                                                                 "for the tcp-response content actions.");
+                                                       s->last_rule_file = rule->conf.file;
+                                                       s->last_rule_line = rule->conf.line;
                                                        goto internal;
                                                }
                                                channel_dont_close(rep);