MEDIUM: applet: Simplify a bit API to exchange data with applets

Default .rcv_buf and .snd_buf functions that applets can use are now
specialized to manipulate raw buffers or HTX buffers.

Thus a TCP applet should use appctx_raw_rcv_buf() and appctx_raw_snd_buf()
while HTTP applet should use appctx_htx_rcv_buf() and appctx_htx_snd_buf().

Note that the appctx is now directly passed to these functions instead of
the SC.
This commit is contained in:
Christopher Faulet
2024-01-26 15:41:46 +01:00
parent 868205943c
commit ee53d8421f
6 changed files with 88 additions and 67 deletions

View File

@@ -3159,8 +3159,8 @@ struct applet http_cache_applet = {
.obj_type = OBJ_TYPE_APPLET,
.name = "<CACHE>", /* used for logging */
.fct = http_cache_io_handler,
.rcv_buf = appctx_rcv_buf,
.snd_buf = appctx_snd_buf,
.rcv_buf = appctx_htx_rcv_buf,
.snd_buf = appctx_htx_snd_buf,
.fastfwd = http_cache_fastfwd,
.release = http_cache_applet_release,
};