packages/net/haproxy/patches/024-BUG-MEDIUM-spoe-Queue-message-only-if-no-SPOE-applet-is-attached-to-the-stream.patch
Christian Lachner b7d6096f54 haproxy: Update all patches for HAProxy v1.8.19
- Add new patches (see https://www.haproxy.org/bugs/bugs-1.8.19.html)
- Raise PKG_RELEASE to 4

Signed-off-by: Christian Lachner <gladiac@gmail.com>
2019-04-26 08:56:27 +02:00

42 lines
1.7 KiB
Diff

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