]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: spoe: Don't report error on applet release if filter is in DONE state
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 13 May 2025 15:45:18 +0000 (17:45 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 13 May 2025 17:51:40 +0000 (19:51 +0200)
When the SPOE applet was released, if a SPOE filter context was still
attached to it, an error was reported to the filter. However, there is no
reason to report an error if the ACK message was already received. Because
of this bug, if the ACK message is received and the SPOE connection is
immediately closed, this prevents the ACK message to be processed.

This patch should be backported to 3.1.

src/flt_spoe.c

index cec31a8559d54072270ba4b2303b1114143a0a27..6810008f22092d82dc4a4a9b5e46af59ac144369 100644 (file)
@@ -441,8 +441,10 @@ static void spoe_release_appctx(struct appctx *appctx)
        if (spoe_appctx->spoe_ctx)  {
                /* Report an error to stream */
                spoe_appctx->spoe_ctx->spoe_appctx = NULL;
-               spoe_appctx->spoe_ctx->state = SPOE_CTX_ST_ERROR;
-               spoe_appctx->spoe_ctx->status_code = (spoe_appctx->status_code + 0x100);
+               if (spoe_appctx->spoe_ctx->state != SPOE_CTX_ST_DONE) {
+                       spoe_appctx->spoe_ctx->state = SPOE_CTX_ST_ERROR;
+                       spoe_appctx->spoe_ctx->status_code = (spoe_appctx->status_code + 0x100);
+               }
                task_wakeup(spoe_appctx->spoe_ctx->strm->task, TASK_WOKEN_MSG);
        }