From: Christopher Faulet Date: Thu, 15 Feb 2024 10:23:00 +0000 (+0100) Subject: MINOR: applet: Always use applet API to set appctx flags X-Git-Tag: v3.0-dev7~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2403a412c21a624bbae12cffcd2de3ef722ba27;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/applet.c b/src/applet.c index 6774e1a884..def5c2aff6 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 6cbfe7a821..2c11db99df 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 a6541a264a..39e232591d 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; } }