Skip to content

Commit

Permalink
MINOR: stream: Save last evaluated rule on invalid yield
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 0b76054)
[cf: Of course the mentionned commit to be backported with this one is wrong. It
     must be "BUG/MINOR: http-ana: Report internal error if an action yields on
     a final eval"].
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit 533b6f3)
Signed-off-by: Christopher Faulet <[email protected]>
(cherry picked from commit fd5fc89)
Signed-off-by: Christopher Faulet <[email protected]>
  • Loading branch information
capflam committed Nov 6, 2024
1 parent d453a56 commit 63b68cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/http_ana.c
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,8 @@ static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct lis
send_log(s->be, LOG_WARNING,
"Internal error: action yields while it is no long allowed "
"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;
goto end;
}
Expand Down Expand Up @@ -2875,6 +2877,8 @@ static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct lis
send_log(s->be, LOG_WARNING,
"Internal error: action yields while it is no long allowed "
"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;
goto end;
}
Expand Down
4 changes: 4 additions & 0 deletions src/tcp_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ int tcp_inspect_request(struct stream *s, struct channel *req, int an_bit)
send_log(s->be, LOG_WARNING,
"Internal error: yield not allowed if the inspect-delay expired "
"for the tcp-request content actions.");
s->last_rule_file = rule->conf.file;
s->last_rule_line = rule->conf.line;
goto internal;
}
goto missing_data;
Expand Down Expand Up @@ -355,6 +357,8 @@ int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit)
send_log(s->be, LOG_WARNING,
"Internal error: yield not allowed if the inspect-delay expired "
"for the tcp-response content actions.");
s->last_rule_file = rule->conf.file;
s->last_rule_line = rule->conf.line;
goto internal;
}
channel_dont_close(rep);
Expand Down

0 comments on commit 63b68cd

Please sign in to comment.