]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: flt-spoe: Set/test applet flags instead of SE flags from I/O handler
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Feb 2025 09:42:19 +0000 (10:42 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 10:19:32 +0000 (11:19 +0100)
The SPOE applet is using the new applet API. Thus end of input, end of
stream and errors must be reported using the applet flags, not the SE
flags. This was not the case. So let's fix it.

It seems this bug is harmless for now.

This patch must be backported to 3.1.

src/flt_spoe.c

index 7aa354dcbf7af64eabacba3a9410edbb942abd93..0e78d49cbd1a426b0918da07188151d8e7dcc7d0 100644 (file)
@@ -490,7 +490,7 @@ static void spoe_handle_appctx(struct appctx *appctx)
        if (!appctx_get_buf(appctx, &appctx->inbuf))
                goto out;
 
-       if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
+       if (unlikely(applet_fl_test(appctx, APPCTX_FL_EOS|APPCTX_FL_ERROR))) {
                b_reset(&appctx->inbuf);
                applet_fl_clr(appctx, APPCTX_FL_INBLK_FULL);
                goto out;
@@ -509,11 +509,11 @@ static void spoe_handle_appctx(struct appctx *appctx)
 
                case SPOE_APPCTX_ST_EXIT:
                        appctx->st0 = SPOE_APPCTX_ST_END;
-                       se_fl_set(appctx->sedesc, SE_FL_EOS);
+                       applet_set_eos(appctx);
                        if (SPOE_APPCTX(appctx)->status_code != SPOP_ERR_NONE)
-                               se_fl_set(appctx->sedesc, SE_FL_ERROR);
+                               applet_set_error(appctx);
                        else
-                               se_fl_set(appctx->sedesc, SE_FL_EOI);
+                               applet_set_eoi(appctx);
                        __fallthrough;
 
                case SPOE_APPCTX_ST_END: