BUG/MINOR: http-ana: Report internal error if an action yields on a final eval

This was already performed for tcp actions at content level, but not for
HTTP actions. It is always a bug, so it must be reported accordingly.

This patch may be backported to all stable versions.
This commit is contained in:
Christopher Faulet 2024-10-29 18:09:51 +01:00
parent 3c09b34325
commit 65ea29dcf8

View File

@ -2744,6 +2744,13 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
goto end; goto end;
case ACT_RET_YIELD: case ACT_RET_YIELD:
s->current_rule = rule; s->current_rule = rule;
if (act_opts & ACT_OPT_FINAL) {
send_log(s->be, LOG_WARNING,
"Internal error: action yields while it is no long allowed "
"for the http-request actions.");
rule_ret = HTTP_RULE_RES_ERROR;
goto end;
}
rule_ret = HTTP_RULE_RES_YIELD; rule_ret = HTTP_RULE_RES_YIELD;
goto end; goto end;
case ACT_RET_ERR: case ACT_RET_ERR:
@ -2909,6 +2916,13 @@ resume_execution:
goto end; goto end;
case ACT_RET_YIELD: case ACT_RET_YIELD:
s->current_rule = rule; s->current_rule = rule;
if (act_opts & ACT_OPT_FINAL) {
send_log(s->be, LOG_WARNING,
"Internal error: action yields while it is no long allowed "
"for the http-response/http-after-response actions.");
rule_ret = HTTP_RULE_RES_ERROR;
goto end;
}
rule_ret = HTTP_RULE_RES_YIELD; rule_ret = HTTP_RULE_RES_YIELD;
goto end; goto end;
case ACT_RET_ERR: case ACT_RET_ERR: