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.
This commit is contained in:
Christopher Faulet 2024-10-29 18:15:20 +01:00
parent 65ea29dcf8
commit 0b7605491e
2 changed files with 8 additions and 0 deletions

View 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, send_log(s->be, LOG_WARNING,
"Internal error: action yields while it is no long allowed " "Internal error: action yields while it is no long allowed "
"for the http-request actions."); "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; rule_ret = HTTP_RULE_RES_ERROR;
goto end; goto end;
} }
@ -2920,6 +2922,8 @@ resume_execution:
send_log(s->be, LOG_WARNING, send_log(s->be, LOG_WARNING,
"Internal error: action yields while it is no long allowed " "Internal error: action yields while it is no long allowed "
"for the http-response/http-after-response actions."); "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; rule_ret = HTTP_RULE_RES_ERROR;
goto end; goto end;
} }

View File

@ -175,6 +175,8 @@ resume_execution:
send_log(s->be, LOG_WARNING, send_log(s->be, LOG_WARNING,
"Internal error: yield not allowed if the inspect-delay expired " "Internal error: yield not allowed if the inspect-delay expired "
"for the tcp-request content actions."); "for the tcp-request content actions.");
s->last_rule_file = rule->conf.file;
s->last_rule_line = rule->conf.line;
goto internal; goto internal;
} }
goto missing_data; goto missing_data;
@ -357,6 +359,8 @@ resume_execution:
send_log(s->be, LOG_WARNING, send_log(s->be, LOG_WARNING,
"Internal error: yield not allowed if the inspect-delay expired " "Internal error: yield not allowed if the inspect-delay expired "
"for the tcp-response content actions."); "for the tcp-response content actions.");
s->last_rule_file = rule->conf.file;
s->last_rule_line = rule->conf.line;
goto internal; goto internal;
} }
channel_dont_close(rep); channel_dont_close(rep);