]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn-stream/applet: Stop setting appctx as the endpoint context
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 May 2022 15:29:37 +0000 (17:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 May 2022 14:13:22 +0000 (16:13 +0200)
The appctx is already the endpoint target. It is confusing to also use it to
set the endpoint context. So, never set the endpoint ctx when an appctx is
created or attached to an existing conn-stream.

src/applet.c
src/conn_stream.c

index 42d46f83f96303815e80d69d42ebe0ce2f8c87a8..d5eb46a676694e70a99b273450fb134c8aec438a 100644 (file)
@@ -51,7 +51,6 @@ struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp, unsig
                if (!endp)
                        goto fail_endp;
                endp->target = appctx;
-               endp->ctx = appctx;
                endp->flags |= (CS_EP_T_APPLET|CS_EP_ORPHAN);
        }
        appctx->endp = endp;
index 8bf9d52d86b1764329a813475da76a297f1e1659..7fc3a493552fb3d7c890f9bfd5b068fef572fbf4 100644 (file)
@@ -276,10 +276,9 @@ int cs_attach_mux(struct conn_stream *cs, void *target, void *ctx)
  * removed. This function is called by a stream when a backend applet is
  * registered.
  */
-static void cs_attach_applet(struct conn_stream *cs, void *target, void *ctx)
+static void cs_attach_applet(struct conn_stream *cs, void *target)
 {
        cs->endp->target = target;
-       cs->endp->ctx = ctx;
        cs->endp->flags |= CS_EP_T_APPLET;
        cs->endp->flags &= ~CS_EP_DETACHED;
        if (cs_strm(cs)) {
@@ -479,7 +478,7 @@ struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app)
        appctx = appctx_new_here(app, cs->endp);
        if (!appctx)
                return NULL;
-       cs_attach_applet(cs, appctx, appctx);
+       cs_attach_applet(cs, appctx);
        appctx->t->nice = __cs_strm(cs)->task->nice;
        cs_cant_get(cs);
        appctx_wakeup(appctx);