Skip to content

Commit 0b76054

Browse files
committed
MINOR: stream: Save last evaluated rule on invalid yield
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.
1 parent 65ea29d commit 0b76054

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/http_ana.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,6 +2748,8 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
27482748
send_log(s->be, LOG_WARNING,
27492749
"Internal error: action yields while it is no long allowed "
27502750
"for the http-request actions.");
2751+
s->last_rule_file = rule->conf.file;
2752+
s->last_rule_line = rule->conf.line;
27512753
rule_ret = HTTP_RULE_RES_ERROR;
27522754
goto end;
27532755
}
@@ -2920,6 +2922,8 @@ static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct lis
29202922
send_log(s->be, LOG_WARNING,
29212923
"Internal error: action yields while it is no long allowed "
29222924
"for the http-response/http-after-response actions.");
2925+
s->last_rule_file = rule->conf.file;
2926+
s->last_rule_line = rule->conf.line;
29232927
rule_ret = HTTP_RULE_RES_ERROR;
29242928
goto end;
29252929
}

src/tcp_rules.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ int tcp_inspect_request(struct stream *s, struct channel *req, int an_bit)
175175
send_log(s->be, LOG_WARNING,
176176
"Internal error: yield not allowed if the inspect-delay expired "
177177
"for the tcp-request content actions.");
178+
s->last_rule_file = rule->conf.file;
179+
s->last_rule_line = rule->conf.line;
178180
goto internal;
179181
}
180182
goto missing_data;
@@ -357,6 +359,8 @@ int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit)
357359
send_log(s->be, LOG_WARNING,
358360
"Internal error: yield not allowed if the inspect-delay expired "
359361
"for the tcp-response content actions.");
362+
s->last_rule_file = rule->conf.file;
363+
s->last_rule_line = rule->conf.line;
360364
goto internal;
361365
}
362366
channel_dont_close(rep);

0 commit comments

Comments
 (0)