#include <haproxy/buf-t.h>
#include <haproxy/mux_quic-t.h>
-/* H3 unidirectional stream types (does not exist for bidirectional streams) */
-#define H3_UNI_STRM_TP_CONTROL_STREAM 0x00
-#define H3_UNI_STRM_TP_PUSH_STREAM 0x01
-#define H3_UNI_STRM_TP_QPACK_ENCODER 0x02
-#define H3_UNI_STRM_TP_QPACK_DECODER 0x03
+/* H3 unidirecational stream types
+ * Emitted as the first byte on the stream to differentiate it.
+ */
+#define H3_UNI_S_T_CTRL 0x00
+#define H3_UNI_S_T_PUSH 0x01
+#define H3_UNI_S_T_QPACK_ENC 0x02
+#define H3_UNI_S_T_QPACK_DEC 0x03
/* Must be the last one */
-#define H3_UNI_STRM_TP_MAX H3_UNI_STRM_TP_QPACK_DECODER
+#define H3_UNI_S_T_MAX H3_UNI_S_T_QPACK_DEC
/* Settings */
#define H3_SETTINGS_QPACK_MAX_TABLE_CAPACITY 0x01
quic_int_getsize(h3_settings_max_field_section_size);
}
- b_quic_enc_int(&pos, H3_UNI_STRM_TP_CONTROL_STREAM);
+ b_quic_enc_int(&pos, H3_UNI_S_T_CTRL);
/* Build a SETTINGS frame */
b_quic_enc_int(&pos, H3_FT_SETTINGS);
b_quic_enc_int(&pos, frm_len);
b = h3_b_dup(rxbuf);
/* First octets: the uni-stream type */
- if (!b_quic_dec_int(&strm_type, &b, &len) || strm_type > H3_UNI_STRM_TP_MAX)
+ if (!b_quic_dec_int(&strm_type, &b, &len) || strm_type > H3_UNI_S_T_MAX)
return 0;
qcs_consume(qcs, len);
* same type of uni-stream (even for Push stream which is not supported at this time.
*/
switch (strm_type) {
- case H3_UNI_STRM_TP_CONTROL_STREAM:
+ case H3_UNI_S_T_CTRL:
if (h3c->rctrl.qcs) {
h3c->err = H3_STREAM_CREATION_ERROR;
return 0;
h3c->rctrl.cb = h3_control_recv;
qcs_subscribe(qcs, SUB_RETRY_RECV, &h3c->rctrl.wait_event);
break;
- case H3_UNI_STRM_TP_PUSH_STREAM:
+ case H3_UNI_S_T_PUSH:
/* NOT SUPPORTED */
break;
- case H3_UNI_STRM_TP_QPACK_ENCODER:
+ case H3_UNI_S_T_QPACK_ENC:
if (h3c->rqpack_enc.qcs) {
h3c->err = H3_STREAM_CREATION_ERROR;
return 0;
h3c->rqpack_enc.cb = qpack_decode_enc;
qcs_subscribe(qcs, SUB_RETRY_RECV, &h3c->rqpack_enc.wait_event);
break;
- case H3_UNI_STRM_TP_QPACK_DECODER:
+ case H3_UNI_S_T_QPACK_DEC:
if (h3c->rqpack_dec.qcs) {
h3c->err = H3_STREAM_CREATION_ERROR;
return 0;