]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux-h2: Don't expect more HTX data on 1xx interim responses
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Sep 2026 08:01:59 +0000 (10:01 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Sep 2026 12:05:25 +0000 (14:05 +0200)
Commit b70921f2c ("BUG/MINOR: mux-h2: Properly handle full or truncated HTX
messages on shut") introduced a regression. When the response start-line had
the HTX_SL_F_XFER_LEN flag set, the H2 stream was flagged with
H2_SF_MORE_HTX_DATA, as if a payload was expected after the response
headers. This was also set for 1xx interim responses. If a final response
with an unknown length was received (no HTX_SL_F_XFER_LEN set), the flag
H2_SF_MORE_HTX_DATA was not removed, leading to an error. The H2 stream was
seen as truncated when a shut was performed and it was reset with a
RST_STREAM(CANCEL).

To fix the issue, H2_SF_MORE_HTX_DATA flag is no longer set for 1XX interim
responses.

This patch must be backported as far as 2.8.

src/mux_h2.c

index 00272fd034f8f3b062ef4f7148fbdae12f443926..7d05358844ff736d1e6dba91809aef4b78435fa5 100644 (file)
@@ -6738,7 +6738,7 @@ static size_t h2s_snd_fhdrs(struct h2s *h2s, struct htx *htx)
                        BUG_ON(sl); /* Only one start-line expected */
                        sl = htx_get_blk_ptr(htx, blk);
                        h2s->status = sl->info.res.status;
-                       if (sl->flags & HTX_SL_F_XFER_LEN)
+                       if ((sl->flags & HTX_SL_F_XFER_LEN) && (h2s->status == 101 || h2s->status >= 200))
                                h2s->flags |= H2_SF_MORE_HTX_DATA;
                        if ((sl->flags & HTX_SL_F_BODYLESS_RESP) || h2s->status == 204 || h2s->status == 304)
                                h2s->flags |= H2_SF_BODYLESS_RESP;