From: Christopher Faulet Date: Thu, 11 Jan 2024 08:02:17 +0000 (+0100) Subject: MINOR: applet: Add support for callback functions to exchange data with channels X-Git-Tag: v3.0-dev3~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=361b81bfcadc2668756f3b798dc20e30b227d1ca;p=thirdparty%2Fhaproxy.git MINOR: applet: Add support for callback functions to exchange data with channels For now, it is not usable, but this patch introduce the support of callback functions, in the applet structure, to exchange data between channels and applets. It is pretty similar to callback functions defined by muxes. --- diff --git a/include/haproxy/applet-t.h b/include/haproxy/applet-t.h index 0ee4fbc341..51b3b4c8b0 100644 --- a/include/haproxy/applet-t.h +++ b/include/haproxy/applet-t.h @@ -27,6 +27,7 @@ #include #include #include +#include #include /* flags for appctx->state */ @@ -53,6 +54,9 @@ struct applet { int (*init)(struct appctx *); /* callback to init resources, may be NULL. expect 0 if ok, -1 if an error occurs. */ void (*fct)(struct appctx *); /* internal I/O handler, may never be NULL */ + size_t (*rcv_buf)(struct stconn *sc, struct buffer *buf, size_t count, unsigned int flags); /* called from the upper layer to get data */ + size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, unsigned int flags); /* Called from the upper layet to put data */ + /* TODO: ADD fastfwd callback functions */ void (*release)(struct appctx *); /* callback to release resources, may be NULL */ unsigned int timeout; /* execution timeout. */ };