]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: mux-h2: add a new message flag to indicate ext connect support
authorWilly Tarreau <w@1wt.eu>
Tue, 5 May 2026 11:26:43 +0000 (13:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 May 2026 12:09:49 +0000 (14:09 +0200)
The new message flag H2_MSGF_EXT_CONN_OK indicates that the connection
supports extended connect. This will be used in a subsequent fix.

include/haproxy/h2.h
src/mux_h2.c

index 430774e769819f5f05298b9ac2378ccd8b3a4b47..1c76fa4bd27b3cb2199295cfae41d960573bd51e 100644 (file)
@@ -182,7 +182,8 @@ enum h2_err {
 #define H2_MSGF_RSP_1XX        0x0010    // a 1xx ( != 101) HEADERS frame was received
 #define H2_MSGF_BODYLESS_RSP   0x0020    // response message is known to have no body
                                          // (response to HEAD request or 204/304 response)
-#define H2_MSGF_EXT_CONNECT    0x0040    // Extended CONNECT method from rfc 8441
+#define H2_MSGF_EXT_CONNECT    0x0040    // Extended CONNECT method from rfc 8441 is in use
+#define H2_MSGF_EXT_CONN_OK    0x0080    // Extended CONNECT is permitted
 
 #define H2_MAX_STREAM_ID       ((1U << 31) - 1)
 #define H2_MAX_FRAME_LEN       ((1U << 24) - 1)
index 61e7db54b826e313a828bff239e41337aaa4e0d1..4d1bef4b29d3cbe4b371398ac8667d5f3df3c193 100644 (file)
@@ -6285,7 +6285,10 @@ next_frame:
        msgf = (h2c->dff & H2_F_HEADERS_END_STREAM) ? 0 : H2_MSGF_BODY;
        msgf |= (*flags & H2_SF_BODY_TUNNEL) ? H2_MSGF_BODY_TUNNEL: 0;
        /* If an Extended CONNECT has been sent on this stream, set message flag
-        * to convert 200 response to 101 htx response */
+        * to convert 200 response to 101 htx response. We only support this if
+        * the connection supports RFC8441.
+        */
+       msgf |= (h2c->flags & H2_CF_RCVD_RFC8441) ? H2_MSGF_EXT_CONN_OK : 0;
        msgf |= (*flags & H2_SF_EXT_CONNECT_SENT) ? H2_MSGF_EXT_CONNECT: 0;
 
        /* when dealing with trailers, we need to check the content-length */