]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: applet: Add a flag to know an applet is using HTX buffers
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Jul 2025 06:29:11 +0000 (08:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 Aug 2025 09:11:05 +0000 (11:11 +0200)
Multiplexers already explicitly announce their HTX support. Now it is
possible to set flags on applet, it could be handy to do the same. So, now,
HTX aware applets must set the APPLET_FL_HTX flag.

addons/promex/service-prometheus.c
include/haproxy/applet-t.h
src/cache.c
src/hlua.c
src/http_client.c
src/stats-html.c

index 74310a366628cbfcdff53fc9f49006344377ee9a..60f927553f0bc97e6cb15d03d3464aa53127eb48 100644 (file)
@@ -2144,7 +2144,7 @@ static void promex_appctx_handle_io(struct appctx *appctx)
 
 struct applet promex_applet = {
        .obj_type = OBJ_TYPE_APPLET,
-       .flags = APPLET_FL_NEW_API,
+       .flags = APPLET_FL_NEW_API|APPLET_FL_HTX,
        .name = "<PROMEX>", /* used for logging */
        .init = promex_appctx_init,
        .release = promex_appctx_release,
index da6dc5024c865fbc815b97dd32fc10e87a891f93..e10c8240ff0379a6a090b81f92cc8bafb2ab64d5 100644 (file)
@@ -83,6 +83,7 @@ static forceinline char *appctx_show_flags(char *buf, size_t len, const char *de
 
 #define APPLET_FL_NEW_API 0x00000001 /* Set if the applet is based on the new API (using applet's buffers) */
 #define APPLET_FL_WARNED  0x00000002 /* Set when warning was already emitted about a legacy applet */
+#define APPLET_FL_HTX     0x00000004 /* Set if the applet is using HTX buffers */
 
 /* Applet descriptor */
 struct applet {
index 7e86e6b96baf536c1e378817931361d9935c3234..52abe7d2c11b24a8bd76f46ab6cd993602d98f5c 100644 (file)
@@ -3139,7 +3139,7 @@ INITCALL1(STG_REGISTER, http_req_keywords_register, &http_req_actions);
 
 struct applet http_cache_applet = {
        .obj_type = OBJ_TYPE_APPLET,
-       .flags = APPLET_FL_NEW_API,
+       .flags = APPLET_FL_NEW_API|APPLET_FL_HTX,
        .name = "<CACHE>", /* used for logging */
        .fct = http_cache_io_handler,
        .rcv_buf = appctx_htx_rcv_buf,
index 5d17685f6bc6a4896d6cd9f9f41cc8a8017faff7..e8e2f90cf9d29c0943069ac2779416aaa27aa983 100644 (file)
@@ -11611,7 +11611,7 @@ static enum act_parse_ret action_register_service_http(const char **args, int *c
 
        /* Add applet pointer in the rule. */
        rule->applet.obj_type = OBJ_TYPE_APPLET;
-       rule->applet.flags = APPLET_FL_NEW_API;
+       rule->applet.flags = APPLET_FL_NEW_API|APPLET_FL_HTX;
        rule->applet.name = fcn->name;
        rule->applet.init = hlua_applet_http_init;
        rule->applet.rcv_buf = appctx_htx_rcv_buf;
index 875be1199301a83b1d610102f3a569d4b4b0c26b..d72d75ba34a65dd581e5c298a7790c55a0c78853 100644 (file)
@@ -1022,7 +1022,7 @@ void httpclient_applet_release(struct appctx *appctx)
 /* HTTP client applet */
 static struct applet httpclient_applet = {
        .obj_type = OBJ_TYPE_APPLET,
-       .flags = APPLET_FL_NEW_API,
+       .flags = APPLET_FL_NEW_API|APPLET_FL_HTX,
        .name = "<HTTPCLIENT>",
        .fct = httpclient_applet_io_handler,
        .rcv_buf = appctx_htx_rcv_buf,
index cd93630f62b52ed1bb09c93a7ca5d427337d5fac..e533535a869158aa5e7c1b5fdb12fbb1e1228b1a 100644 (file)
@@ -2103,7 +2103,7 @@ static void http_stats_release(struct appctx *appctx)
 
 struct applet http_stats_applet = {
        .obj_type = OBJ_TYPE_APPLET,
-       .flags = APPLET_FL_NEW_API,
+       .flags = APPLET_FL_NEW_API|APPLET_FL_HTX,
        .name = "<STATS>", /* used for logging */
        .fct = http_stats_io_handler,
        .rcv_buf = appctx_htx_rcv_buf,