From 2d9cc85b748ef32cca45d749c504bf73044063c0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 16 May 2022 17:29:37 +0200 Subject: [PATCH] MINOR: conn-stream/applet: Stop setting appctx as the endpoint context 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 | 1 - src/conn_stream.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/applet.c b/src/applet.c index 42d46f83f..d5eb46a67 100644 --- a/src/applet.c +++ b/src/applet.c @@ -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; diff --git a/src/conn_stream.c b/src/conn_stream.c index 8bf9d52d8..7fc3a4935 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -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);