mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 13:21:29 +02:00
MINOR: applet: Add a flag to know an applet is using HTX buffers
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.
This commit is contained in:
parent
1c76e4b2e4
commit
927884a3eb
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user