From: Willy Tarreau Date: Mon, 16 Nov 2026 09:06:42 +0000 (+0100) Subject: MINOR: http-ana: also match text/event-stream with trailing parameters X-Git-Url: https://git.kaiwu.me/http//%22?a=commitdiff_plain;h=9c2b4fe87dcadb052a0495ff29d6e4ae2dfaf7f5;p=haproxy.git MINOR: http-ana: also match text/event-stream with trailing parameters Commit 5ff6ff1b7 ("MINOR: http-ana: automatically enable http-no-delay for streaming events (SSE)") added detection for SSE, but as reported in GH issue #3574, it fails when there's a parameter after the content type because we're using an exact match. Let's instead use istmatchi() that will check the beginning of the string (which is sufficient here). Before: === gateway overhead (gateway minus loopback; negative = loopback noise) === emit->recv (1st token) mean +214.379ms p50 +214.379ms p95 +214.379ms p99 +214.379ms emit->recv (tokens) mean +303.484ms p50 +307.784ms p95 +405.797ms p99 +413.876ms TTFT (client) mean +214.775ms p50 +214.775ms p95 +214.775ms p99 +214.775ms inter-token (client) mean -0.026ms p50 -1.069ms p95 -1.260ms p99 -1.271ms After: === gateway overhead (gateway minus loopback; negative = loopback noise) === emit->recv (1st token) mean +0.046ms p50 +0.046ms p95 +0.046ms p99 +0.046ms emit->recv (tokens) mean +0.214ms p50 +0.234ms p95 +0.305ms p99 +0.322ms TTFT (client) mean +0.493ms p50 +0.493ms p95 +0.493ms p99 +0.493ms inter-token (client) mean -0.001ms p50 +0.230ms p95 +0.283ms p99 +0.299ms This should be backported to 3.4 since the commit above is already there. Thanks to @glenn-jocher for reporting and diagnosinc this limitation. --- diff --git a/src/http_ana.c b/src/http_ana.c index 130fa5974..01a59753b 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1677,7 +1677,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit) struct http_hdr_ctx ctx = { .blk = NULL }; if (http_find_header(htx, ist("content-type"), &ctx, 0) && - isteqi(ctx.value, ist("text/event-stream"))) { + istmatchi(ctx.value, ist("text/event-stream"))) { s->scf->flags |= SC_FL_SND_NEVERWAIT; s->scb->flags |= SC_FL_SND_NEVERWAIT; }