From: Thierry FOURNIER Date: Sun, 20 Dec 2015 18:14:35 +0000 (+0100) Subject: BUG/MAJOR: lua: Do not force the HTTP analysers in use-services X-Git-Tag: v1.7-dev1~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=52e260618881094aae4ffa5cdc8ab33db3faa780;p=thirdparty%2Fhaproxy.git BUG/MAJOR: lua: Do not force the HTTP analysers in use-services INNER and XFERBODY analyzer were set in order to support HTTP applets from TCP rulesets, but this does not work (cf previous patch). Other cases already provides theses analyzers, so their addition is not needed. Furthermore if INNER was set it could cause some headers to be rewritten (ex: connection) after headers were already forwarded, resulting in a crash in buffer_insert_line2(). Special thanks to Bernd Helm for providing very detailed information, captures and stack traces making it possible to spot the root cause here. This fix must be backported to 1.6. --- diff --git a/src/hlua.c b/src/hlua.c index 626053368b..ccee755ecb 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -5781,7 +5781,6 @@ static int hlua_applet_http_init(struct appctx *ctx, struct proxy *px, struct st */ if ((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL) txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | TX_CON_WANT_SCL; - req->analysers |= AN_REQ_HTTP_XFER_BODY; HLUA_INIT(hlua); ctx->ctx.hlua_apphttp.left_bytes = -1; @@ -5876,7 +5875,6 @@ static void hlua_applet_http_fct(struct appctx *ctx) struct stream_interface *si = ctx->owner; struct stream *strm = si_strm(si); struct channel *res = si_ic(si); - struct channel *req = si_oc(si); struct act_rule *rule = ctx->rule; struct proxy *px = strm->be; struct hlua *hlua = &ctx->ctx.hlua_apphttp.hlua; @@ -5894,12 +5892,6 @@ static void hlua_applet_http_fct(struct appctx *ctx) if (!HLUA_IS_RUNNING(hlua) && !(ctx->ctx.hlua_apphttp.flags & APPLET_DONE)) { - /* enable the minimally required analyzers to handle keep-alive - * and compression on the HTTP response - */ - req->analysers = (req->analysers & AN_REQ_HTTP_BODY) | - AN_REQ_HTTP_XFER_BODY | AN_REQ_HTTP_INNER; - /* Wait for full HTTP analysys. */ if (unlikely(strm->txn->req.msg_state < HTTP_MSG_BODY)) { si_applet_cant_get(si);