]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tcp-rules: Return an internal error if an action yields on a final eval
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 28 Jul 2020 09:30:19 +0000 (11:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 30 Jul 2020 07:31:09 +0000 (09:31 +0200)
On a final evaluation of a tcp-request or tcp-response content ruleset, it is
forbidden for an action to yield. To quickly identify bugs an internal error is
now returned if it happens and a warning log message is emitted.

src/tcp_rules.c

index e09cc3c10a2b0d16fd0960da2561642cad6bf698..984aa501d3106464a413d75564b4b41a05238430 100644 (file)
@@ -161,6 +161,12 @@ resume_execution:
                                                goto end;
                                        case ACT_RET_YIELD:
                                                s->current_rule = rule;
+                                               if (partial & SMP_OPT_FINAL) {
+                                                       send_log(s->be, LOG_WARNING,
+                                                                "Internal error: yield not allowed if the inspect-delay expired "
+                                                                "for the tcp-request content actions.");
+                                                       goto internal;
+                                               }
                                                goto missing_data;
                                        case ACT_RET_DENY:
                                                goto deny;
@@ -313,6 +319,12 @@ resume_execution:
                                                goto end;
                                        case ACT_RET_YIELD:
                                                s->current_rule = rule;
+                                               if (partial & SMP_OPT_FINAL) {
+                                                       send_log(s->be, LOG_WARNING,
+                                                                "Internal error: yield not allowed if the inspect-delay expired "
+                                                                "for the tcp-response content actions.");
+                                                       goto internal;
+                                               }
                                                goto missing_data;
                                        case ACT_RET_DENY:
                                                goto deny;