]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: h3: rename uni stream type constants
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 23 May 2022 12:35:15 +0000 (14:35 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 25 May 2022 13:41:25 +0000 (15:41 +0200)
Cosmetic fix which reduce the name of unidirectional stream constants.
No impact on the code.

include/haproxy/h3.h
src/h3.c

index e61a2d9b2b353008aff85fed1581024c1c671bde..ad9540266cb4bb2b1b1d25d0b91147515e5fa245 100644 (file)
 #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
index c32f5eb739a52720c4f54c2930d24a7db34edb94..75ab2b8487c191a5f238c700f4edb718046ee6c5 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -480,7 +480,7 @@ static int h3_control_send(struct h3_uqs *h3_uqs, void *ctx)
                        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);
@@ -790,7 +790,7 @@ static int h3_attach_ruqs(struct qcs *qcs, void *ctx)
        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);
@@ -799,7 +799,7 @@ static int h3_attach_ruqs(struct qcs *qcs, void *ctx)
         * 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;
@@ -809,10 +809,10 @@ static int h3_attach_ruqs(struct qcs *qcs, void *ctx)
                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;
@@ -822,7 +822,7 @@ static int h3_attach_ruqs(struct qcs *qcs, void *ctx)
                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;