]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3/qpack: fix gcc11 warnings
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 8 Nov 2021 07:57:18 +0000 (08:57 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 8 Nov 2021 07:59:30 +0000 (08:59 +0100)
Fix minor warnings about unused variables and mixed declarations.

This addresses in part github issue #1445.

src/h3.c
src/qpack-enc.c

index cd8f32d5544d887a941c52f3e3a0414659bca771..afcefef599fef9fa230cfa14c35192b1197a8a11 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -133,16 +133,17 @@ static int h3_decode_qcs(struct qcs *qcs, void *ctx)
                {
                        const unsigned char *buf = (const unsigned char *)b_head(rxbuf);
                        size_t len = b_data(rxbuf);
+                       struct buffer htx_buf = BUF_NULL;
                        struct buffer *tmp = get_trash_chunk();
                        struct ist meth = IST_NULL, path = IST_NULL;
-                       struct ist scheme = IST_NULL, authority = IST_NULL;
+                       //struct ist scheme = IST_NULL, authority = IST_NULL;
+                       struct ist authority = IST_NULL;
 
                        if (qpack_decode_fs(buf, len, tmp, list) < 0) {
                                h3->err = QPACK_DECOMPRESSION_FAILED;
                                return -1;
                        }
 
-                       struct buffer htx_buf = BUF_NULL;
                        b_alloc(&htx_buf);
                        htx = htx_from_buf(&htx_buf);
 
@@ -158,8 +159,8 @@ static int h3_decode_qcs(struct qcs *qcs, void *ctx)
                                                meth = list[hdr_idx].v;
                                        else if (isteq(list[hdr_idx].n, ist(":path")))
                                                path = list[hdr_idx].v;
-                                       else if (isteq(list[hdr_idx].n, ist(":scheme")))
-                                               scheme = list[hdr_idx].v;
+                                       //else if (isteq(list[hdr_idx].n, ist(":scheme")))
+                                       //      scheme = list[hdr_idx].v;
                                        else if (isteq(list[hdr_idx].n, ist(":authority")))
                                                authority = list[hdr_idx].v;
                                }
index a5092296dff34ecb90f19a6f4ea86d390618028f..fca2539f4a950283d3c080cc6745453bcd1f82e5 100644 (file)
@@ -120,13 +120,14 @@ int qpack_encode_int_status(struct buffer *out, unsigned int status)
 /* Returns 0 on success else non-zero. */
 int qpack_encode_field_section_line(struct buffer *out)
 {
-       if (b_room(out) < 2)
-               return 1;
-
        char qpack_field_section[] = {
          '\x00',   /* required insert count */
          '\x00',   /* S + delta base */
        };
+
+       if (b_room(out) < 2)
+               return 1;
+
        b_putblk(out, qpack_field_section, 2);
 
        return 0;