The new message flag H2_MSGF_EXT_CONN_OK indicates that the connection
supports extended connect. This will be used in a subsequent fix.
#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)
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 */