From 3cae4049b0cf4a0d2a73a082a970f073020ef105 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Mon, 8 Nov 2021 08:57:18 +0100 Subject: [PATCH] MINOR: h3/qpack: fix gcc11 warnings Fix minor warnings about unused variables and mixed declarations. This addresses in part github issue #1445. --- src/h3.c | 9 +++++---- src/qpack-enc.c | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/h3.c b/src/h3.c index cd8f32d554..afcefef599 100644 --- 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; } diff --git a/src/qpack-enc.c b/src/qpack-enc.c index a5092296df..fca2539f4a 100644 --- a/src/qpack-enc.c +++ b/src/qpack-enc.c @@ -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;