BUG/MINOR: tcp-rules: Set the inspect-delay when a tcp-response action yields
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 29 Jul 2020 10:00:23 +0000 (12:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 30 Jul 2020 08:04:02 +0000 (10:04 +0200)
On a tcp-response content ruleset evaluation, the inspect-delay is engaged when
rule's conditions are not validated but not when the rule's action yields.

This patch must be backported to all supported versions.

(cherry picked from commit 54f3e183c87fa3694a25b3116c724222fc95676b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d3cd85d2c9cc514d84b782e14c33e2bc3215adaa)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/tcp_rules.c

index 6dfd652..5d76c3b 100644 (file)
@@ -378,6 +378,8 @@ resume_execution:
                                case ACT_RET_YIELD:
                                        channel_dont_close(rep);
                                        s->current_rule = rule;
+                                       if (!tick_isset(rep->analyse_exp) && s->be->tcp_rep.inspect_delay)
+                                               rep->analyse_exp = tick_add(now_ms, s->be->tcp_rep.inspect_delay);
                                        DBG_TRACE_DEVEL("waiting for more data", STRM_EV_STRM_ANA|STRM_EV_TCP_ANA, s);
                                        return 0;
                                }