mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: applet: add init function
this patch adds init function for the applet. the HAProxy standard applet (peers, stats, lua) have no standard way for the applet initialisation. This new function pointer have for goal to try to standardize the applet initialization.
This commit is contained in:
parent
2f3867f429
commit
c069cfdfea
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include <types/hlua.h>
|
#include <types/hlua.h>
|
||||||
#include <types/obj_type.h>
|
#include <types/obj_type.h>
|
||||||
|
#include <types/proxy.h>
|
||||||
|
#include <types/stream.h>
|
||||||
#include <common/chunk.h>
|
#include <common/chunk.h>
|
||||||
#include <common/config.h>
|
#include <common/config.h>
|
||||||
|
|
||||||
@ -34,6 +36,8 @@ struct applet {
|
|||||||
enum obj_type obj_type; /* object type = OBJ_TYPE_APPLET */
|
enum obj_type obj_type; /* object type = OBJ_TYPE_APPLET */
|
||||||
/* 3 unused bytes here */
|
/* 3 unused bytes here */
|
||||||
char *name; /* applet's name to report in logs */
|
char *name; /* applet's name to report in logs */
|
||||||
|
int (*init)(struct appctx *, struct proxy *px, struct stream *strm); /* callback to init ressources, may be NULL.
|
||||||
|
expect 1 if ok, 0 if an error occurs, -1 if miss data. */
|
||||||
void (*fct)(struct appctx *); /* internal I/O handler, may never be NULL */
|
void (*fct)(struct appctx *); /* internal I/O handler, may never be NULL */
|
||||||
void (*release)(struct appctx *); /* callback to release resources, may be NULL */
|
void (*release)(struct appctx *); /* callback to release resources, may be NULL */
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user