Le 21/03/2017 à 07:43, Willy Tarreau a écrit :
On Mon, Mar 20, 2017 at 11:08:20AM +0100, Christopher Faulet wrote:
Hi,

Here is a little patch fixing a bug. It should be backported in 1.7.

Thanks Christopher. Are you sure it's *this* minor ? I suspect that not
having it could break keep-alive processing on redirect rules, am I wrong ?


Well, maybe you're right. In almost all cases, this bug has no effect. After a more careful check, I found it leads to a memory leak if a redirect is done on a http-response rule when the HTTP compression is enabled.

So, I set it to MAJOR. Thanks
--
Christopher Faulet
>From 853d3c93b64cb218f707106f8feb0480bef861fc Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Fri, 10 Mar 2017 13:52:30 +0100
Subject: [PATCH] BUG/MAJOR: http: fix typo in http_apply_redirect_rule
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4

Because of this typo, AN_RES_FLT_END was never called when a redirect rule is
applied on a keep-alive connection. In almost all cases, this bug has no
effect. But, it leads to a memory leak if a redirect is done on a http-response
rule when the HTTP compression is enabled.

This patch should be backported in 1.7.
---
 src/proto_http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/proto_http.c b/src/proto_http.c
index 6d55e6a..0cafdb4 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -4279,7 +4279,7 @@ static int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s
 		req->next -= req->sov;
 		req->sov = 0;
 		s->req.analysers = AN_REQ_HTTP_XFER_BODY | (s->req.analysers & AN_REQ_FLT_END);
-		s->res.analysers = AN_RES_HTTP_XFER_BODY | (s->req.analysers & AN_RES_FLT_END);
+		s->res.analysers = AN_RES_HTTP_XFER_BODY | (s->res.analysers & AN_RES_FLT_END);
 		req->msg_state = HTTP_MSG_CLOSED;
 		res->msg_state = HTTP_MSG_DONE;
 		/* Trim any possible response */
-- 
2.9.3

Reply via email to