From aa84e7396e73d2ee7366ea08bc2dc494cab7ee9b Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 9 Nov 2021 17:48:39 +0100 Subject: [PATCH] Revert "BUG/MINOR: http-ana: Don't eval front after-response rules if stopped on back" This reverts commit 597909f4e67866c4f3ecf77f95f2cd4556c0c638 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. (cherry picked from commit 4c5a591b1029ef03c3461a7771483aa523e3111a) Signed-off-by: Christopher Faulet (cherry picked from commit f5db0fc6ccb5bdbbe0c6304968da180fae7d1d52) Signed-off-by: Christopher Faulet --- reg-tests/http-rules/http_after_response.vtc | 14 +++++++------- src/http_ana.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reg-tests/http-rules/http_after_response.vtc b/reg-tests/http-rules/http_after_response.vtc index 0a37daa..af66498 100644 --- a/reg-tests/http-rules/http_after_response.vtc +++ b/reg-tests/http-rules/http_after_response.vtc @@ -182,11 +182,11 @@ client c4 -connect ${h1_feh1_sock} { client c5 -connect ${h1_feh1_sock} { txreq -req GET -url /deny-srv rxresp - expect resp.status == 502 - expect resp.http.be-sl1 == - expect resp.http.be-sl2 == - expect resp.http.be-hdr == - expect resp.http.sl1 == - expect resp.http.sl2 == - expect resp.http.hdr == + expect resp.status == 200 + expect resp.http.be-sl1 == "" + expect resp.http.be-sl2 == "" + expect resp.http.be-hdr == "" + expect resp.http.fe-sl1-crc == 3104968915 + expect resp.http.fe-sl2-crc == 561949791 + expect resp.http.fe-hdr-crc == 623352154 } -run diff --git a/src/http_ana.c b/src/http_ana.c index 3996d1b..d171793 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -3116,7 +3116,7 @@ int http_eval_after_res_rules(struct stream *s) } ret = http_res_get_intercept_rule(s->be, &s->be->http_after_res_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) ret = http_res_get_intercept_rule(sess->fe, &sess->fe->http_after_res_rules, s); end: -- 1.7.10.4