]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: hq-interop: prevent double EOM on request with standalone FIN
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Oct 2026 08:37:06 +0000 (10:37 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Oct 2026 08:57:53 +0000 (10:57 +0200)
Previously, HTX EOM was unconditionnaly set during HTTP/0.9 to HTX
request conversion. This was valid as content was only parsed when all
STREAM were received.

However, this has changed in 3.2 with support for incomplete request and
standalone FIN in HTTP/0.9 parser. The objective is to better test a
mechanism close to HTTP/3 parser. But unconditionnal EOM was not
adjusted. Thus, EOM would be set two times per message if FIN is
transmitted via a dedicated empty STREAM frame.

Previously, this was silently ignored by stream layer. However, this is
not case anymore since conversion of HTX EOM from a message level to a
block level flag. A new BUG_ON() added in htx_add_blk() would report
incorrect blocks found after EOM : this may be triggered in case the
second EOM is reported through an EOT block.

Fix this only setting EOM if fin is set during HTTP/0.9 request parsing.
Handling of standalone FIN is already supported here so there is no need
for more changes. Now, HTTP/0.9 parser can now considered even more
closer to HTTP/3.

This should be backported up to 3.2.

src/hq_interop.c

index 663e9fead22391fc599192e8cf14e88548154627..9ffe2cb00624ea5ecee8506d24b1d1dd1f4bddef 100644 (file)
@@ -109,7 +109,8 @@ static ssize_t hq_interop_rcv_buf_req(struct qcs *qcs, struct buffer *b, int fin
        sl->info.req.meth = find_http_meth(istptr(meth), 3);
 
        htx_add_endof(htx, HTX_BLK_EOH);
-       htx_set_eom(htx);
+       if (fin)
+               htx_set_eom(htx);
        htx_to_buf(htx, &htx_buf);
 
        hq_trace_req(meth, path, QMUX_EV_QCC_RECV, ist(TRC_LOC), __FUNCTION__, qcs, qcs->qcc);