From d2403a412c21a624bbae12cffcd2de3ef722ba27 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 15 Feb 2024 11:23:00 +0100 Subject: [PATCH] MINOR: applet: Always use applet API to set appctx flags Some appctx flags were still set manually while there is a dedicated function to do so. Be sure to always use applet_fl_set() to set appctx flags. --- src/applet.c | 2 +- src/cache.c | 4 ++-- src/stats.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/applet.c b/src/applet.c index 6774e1a88..def5c2aff 100644 --- a/src/applet.c +++ b/src/applet.c @@ -269,7 +269,7 @@ struct appctx *appctx_new_on(struct applet *applet, struct sedesc *sedesc, int t if (applet->rcv_buf != NULL && applet->snd_buf != NULL) { appctx->t->process = task_process_applet; - appctx->flags |= APPCTX_FL_INOUT_BUFS; + applet_fl_set(appctx, APPCTX_FL_INOUT_BUFS); } else appctx->t->process = task_run_applet; diff --git a/src/cache.c b/src/cache.c index 6cbfe7a82..2c11db99d 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1784,7 +1784,7 @@ static void http_cache_io_handler(struct appctx *appctx) goto exit; if (!appctx_get_buf(appctx, &appctx->outbuf)) { - appctx->flags |= APPCTX_FL_OUTBLK_ALLOC; + applet_fl_set(appctx, APPCTX_FL_OUTBLK_ALLOC); goto exit; } @@ -1842,7 +1842,7 @@ static void http_cache_io_handler(struct appctx *appctx) if (len) { ret = htx_cache_dump_msg(appctx, res_htx, len, HTX_BLK_UNUSED); if (ret < len) { - appctx->flags |= APPCTX_FL_OUTBLK_FULL; + applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); goto out; } } diff --git a/src/stats.c b/src/stats.c index a6541a264..39e232591 100644 --- a/src/stats.c +++ b/src/stats.c @@ -335,7 +335,7 @@ int stats_is_full(struct appctx *appctx, struct buffer *buf, struct htx *htx) { if (htx) { if (htx_almost_full(htx)) { - appctx->flags |= APPCTX_FL_OUTBLK_FULL; + applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); goto full; } } @@ -4503,7 +4503,7 @@ static void http_stats_io_handler(struct appctx *appctx) goto out; if (!appctx_get_buf(appctx, &appctx->outbuf)) { - appctx->flags |= APPCTX_FL_OUTBLK_ALLOC; + applet_fl_set(appctx, APPCTX_FL_OUTBLK_ALLOC); goto out; } @@ -4557,7 +4557,7 @@ static void http_stats_io_handler(struct appctx *appctx) */ if (htx_is_empty(res_htx)) { if (!htx_add_endof(res_htx, HTX_BLK_EOT)) { - appctx->flags |= APPCTX_FL_OUTBLK_FULL; + applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); goto out; } }