MINOR: applet: Add appctx_init() helper fnuction
It is just a helper function that call the .init applet callback function,
if it exists. This will simplify a bit the init stage when a new applet is
started. For now, this callback function is only used when a new service is
started.
diff --git a/src/stream.c b/src/stream.c
index dd3358e..29d1a60 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -997,9 +997,8 @@
return ACT_RET_ERR;
/* Finish initialisation of the context. */
- memset(&appctx->ctx, 0, sizeof(appctx->ctx));
appctx->rule = rule;
- if (appctx->applet->init && !appctx->applet->init(appctx))
+ if (appctx_init(appctx) == -1)
return ACT_RET_ERR;
}
else