]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: remove the HTX EOM block on H2 response headers
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2018 11:28:01 +0000 (12:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2018 11:31:51 +0000 (12:31 +0100)
If we decided to emit the end of stream flag on the H2 response headers
frame, we must remove the EOM block from the HTX stream, otherwise it
will lead to an extra DATA frame being sent with the ES flag and will
violate the protocol.

src/mux_h2.c

index bd329cc1266f28148430eb1ca060a8e03507bd80..bab4c851df5fbf6894441c755ff8edf2b625f13b 100644 (file)
@@ -3762,6 +3762,9 @@ static size_t h2s_htx_frt_make_resp_headers(struct h2s *h2s, struct htx *htx)
                ret += htx_get_blksz(blk);
                blk = htx_remove_blk(htx, blk);
        }
+
+       if (blk_end && htx_get_blk_type(blk_end) == HTX_BLK_EOM)
+               htx_remove_blk(htx, blk_end);
  end:
        return ret;
  full: