summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faulet <cfaulet@haproxy.com>2023-05-15 17:31:26 +0200
committerChristopher Faulet <cfaulet@haproxy.com>2023-05-17 09:21:01 +0200
commit2d5a5665fe6c03f1fae1af22d21138347d9acab1 (patch)
tree8c713ed93f48fa47355e557e8437187b75441acf
parentb93758cec977334059b138e9fb75c25982dda53d (diff)
downloadhaproxy-2d5a5665fe6c03f1fae1af22d21138347d9acab1.tar.gz
BUG/MINOR: tcp-rules: Don't shortened the inspect-delay when EOI is set
A regression was introduced with the commit cb59e0bc3 ("BUG/MINOR: tcp-rules: Stop content rules eval on read error and end-of-input"). We should not shorten the inspect-delay when the EOI flag is set on the SC. Idea of the inspect-delay is to wait a TCP rule is matching. It is only interrupted if an error occurs, on abort or if the peer shuts down. It is also interrupted if the buffer is full. This last case is a bit ambiguous and discutable. It could be good to add ACLS, like "wait_complete" and "wait_full" to do so. But for now, we only remove the test on SC_FL_EOI flag. This patch must be backported to all stable versions.
-rw-r--r--src/tcp_rules.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tcp_rules.c b/src/tcp_rules.c
index 3568ca23c..c7bdddcca 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -116,7 +116,7 @@ int tcp_inspect_request(struct stream *s, struct channel *req, int an_bit)
* - if one rule returns KO, then return KO
*/
- if ((s->scf->flags & (SC_FL_EOI|SC_FL_EOS|SC_FL_ABRT_DONE)) || channel_full(req, global.tune.maxrewrite) ||
+ if ((s->scf->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)) || channel_full(req, global.tune.maxrewrite) ||
sc_waiting_room(s->scf) ||
!s->be->tcp_req.inspect_delay || tick_is_expired(s->rules_exp, now_ms)) {
partial = SMP_OPT_FINAL;
@@ -298,7 +298,7 @@ int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit)
* - if one rule returns OK, then return OK
* - if one rule returns KO, then return KO
*/
- if ((s->scb->flags & (SC_FL_EOI|SC_FL_EOS|SC_FL_ABRT_DONE)) || channel_full(rep, global.tune.maxrewrite) ||
+ if ((s->scb->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)) || channel_full(rep, global.tune.maxrewrite) ||
sc_waiting_room(s->scb) ||
!s->be->tcp_rep.inspect_delay || tick_is_expired(s->rules_exp, now_ms)) {
partial = SMP_OPT_FINAL;