Revert "BUG/MINOR: http-ana: Don't eval front after-response rules if stopped on back"

This reverts commit 597909f4e6

http-after-response rules evaluation was changed to do the same that was
done for http-response, in the code. However, the opposite must be performed
instead. Only the rules of the current section must be stopped. Thus the
above commit is reverted and the http-response rules evaluation will be
fixed instead.

Note that only "allow" action is concerned. It is most probably an uncommon
action for an http-after-request rule.

This patch must be backported as far as 2.2 if the above commit was
backported.
This commit is contained in:
Christopher Faulet 2021-11-09 17:48:39 +01:00
parent 46f46df300
commit 4c5a591b10
2 changed files with 8 additions and 9 deletions

View File

@ -182,11 +182,11 @@ client c4 -connect ${h1_feh1_sock} {
client c5 -connect ${h1_feh1_sock} { client c5 -connect ${h1_feh1_sock} {
txreq -req GET -url /deny-srv txreq -req GET -url /deny-srv
rxresp rxresp
expect resp.status == 502 expect resp.status == 200
expect resp.http.be-sl1 == <undef> expect resp.http.be-sl1 == ""
expect resp.http.be-sl2 == <undef> expect resp.http.be-sl2 == ""
expect resp.http.be-hdr == <undef> expect resp.http.be-hdr == ""
expect resp.http.sl1 == <undef> expect resp.http.fe-sl1-crc == 3104968915
expect resp.http.sl2 == <undef> expect resp.http.fe-sl2-crc == 561949791
expect resp.http.hdr == <undef> expect resp.http.fe-hdr-crc == 623352154
} -run } -run

View File

@ -2982,12 +2982,11 @@ int http_eval_after_res_rules(struct stream *s)
vars_init_head(&s->vars_reqres, SCOPE_RES); vars_init_head(&s->vars_reqres, SCOPE_RES);
} }
def_rules = (s->be->defpx ? &s->be->defpx->http_after_res_rules : NULL); def_rules = (s->be->defpx ? &s->be->defpx->http_after_res_rules : NULL);
rules = &s->be->http_after_res_rules; rules = &s->be->http_after_res_rules;
ret = http_res_get_intercept_rule(s->be, def_rules, rules, s); ret = http_res_get_intercept_rule(s->be, def_rules, rules, s);
if (ret == HTTP_RULE_RES_CONT && sess->fe != s->be) { if ((ret == HTTP_RULE_RES_CONT || ret == HTTP_RULE_RES_STOP) && sess->fe != s->be) {
def_rules = ((sess->fe->defpx && sess->fe->defpx != s->be->defpx) ? &sess->fe->defpx->http_after_res_rules : NULL); def_rules = ((sess->fe->defpx && sess->fe->defpx != s->be->defpx) ? &sess->fe->defpx->http_after_res_rules : NULL);
rules = &sess->fe->http_after_res_rules; rules = &sess->fe->http_after_res_rules;
ret = http_res_get_intercept_rule(sess->fe, def_rules, rules, s); ret = http_res_get_intercept_rule(sess->fe, def_rules, rules, s);