]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: applet: Always use applet API to set appctx flags
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 15 Feb 2024 10:23:00 +0000 (11:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 28 Mar 2024 16:28:20 +0000 (17:28 +0100)
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
src/cache.c
src/stats.c

index 6774e1a884211cd39d4c703554748927c340a038..def5c2aff64ab1d7140fd94dd913e901b849339c 100644 (file)
@@ -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;
index 6cbfe7a8212f25c95fa04e8d4c010ea6d4c12100..2c11db99dfbc0d563e079ce2c76e519fcfd0bbe8 100644 (file)
@@ -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;
                        }
                }
index a6541a264ab47921490bdefa2462093a65a209aa..39e232591dd270e55f4ec953fd9d9728124e3668 100644 (file)
@@ -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;
                        }
                }