1 commit 308f39235ca8ce09442bf89cd8aa7f4f6b74f214
2 Author: Christopher Faulet <cfaulet@haproxy.com>
3 Date: Wed Apr 10 14:02:12 2019 +0200
5 BUG/MEDIUM: spoe: Queue message only if no SPOE applet is attached to the stream
7 If a SPOE applet is already attached to a stream to handle its messages, we must
8 not queue them. Otherwise it could be handled by another applet leading to
9 errors. This happens with fragmented messages only. When the first framgnent is
10 sent, the SPOE applet sending it is attached to the stream. It should be used to
11 send all other fragments.
13 This patch must be backported to 1.9 and 1.8.
15 (cherry picked from commit 3e86cec05ec9cf848abd8f9a79928410874b778d)
16 [wla: s/_HA_ATOMIC_ADD/HA_ATOMIC_ADD/ in context]
17 Signed-off-by: William Lallemand <wlallemand@haproxy.org>
18 (cherry picked from commit c3468fe1de262c9977510efb1ae47ff1a04c299c)
19 Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
21 diff --git a/src/flt_spoe.c b/src/flt_spoe.c
22 index 66d26f34..64601e3f 100644
25 @@ -2086,11 +2086,14 @@ spoe_queue_context(struct spoe_context *ctx)
29 - /* Add the SPOE context in the sending queue and update all running
31 - LIST_ADDQ(&agent->rt[tid].sending_queue, &ctx->list);
32 + /* Add the SPOE context in the sending queue if the stream has no applet
33 + * already assigned and wakeup all idle applets. Otherwise, don't queue
35 if (agent->rt[tid].sending_rate)
36 agent->rt[tid].sending_rate--;
37 + if (ctx->frag_ctx.spoe_appctx)
39 + LIST_ADDQ(&agent->rt[tid].sending_queue, &ctx->list);
41 SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p"
42 " - Add stream in sending queue"