]> git.kaiwu.me - haproxy.git/commit
MINOR: http-ana: also match text/event-stream with trailing parameters
authorWilly Tarreau <w@1wt.eu>
Mon, 16 Nov 2026 09:06:42 +0000 (10:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Nov 2026 09:09:24 +0000 (10:09 +0100)
commit9c2b4fe87dcadb052a0495ff29d6e4ae2dfaf7f5
tree97771e4728b5f0e19d18b424e0e719dc95aab6ca
parent64050a8b69a81243c509961a3c901191dac1290f
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.
src/http_ana.c