]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: lua: Do not force the HTTP analysers in use-services
authorThierry FOURNIER <tfournier@arpalert.org>
Sun, 20 Dec 2015 18:14:35 +0000 (19:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 20 Dec 2015 22:13:01 +0000 (23:13 +0100)
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.

src/hlua.c

index 626053368bd82ac2744f2f36e9217d364bc7c169..ccee755ecb6a4df2b770a989fa79852368f7dcbc 100644 (file)
@@ -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);