From: Amaury Denoyelle Date: Tue, 31 May 2022 13:21:27 +0000 (+0200) Subject: BUG/MINOR: qpack: do not consider empty enc/dec stream as error X-Git-Tag: v2.6.0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5869cb669e31f728440db63ff73db163ae38ae3a;p=thirdparty%2Fhaproxy.git BUG/MINOR: qpack: do not consider empty enc/dec stream as error When parsing QPACK encoder/decoder streams, h3_decode_qcs() displays an error trace if they are empty. Change the return code used in QPACK code to avoid this trace. To uniformize with MUX/H3 code, 0 is now used to indicate success. Beyond this spurious error trace, this bug has no impact. --- diff --git a/src/h3.c b/src/h3.c index 831dc19de6..1b8e378310 100644 --- a/src/h3.c +++ b/src/h3.c @@ -238,11 +238,11 @@ static int h3_parse_uni_stream_no_h3(struct qcs *qcs, struct ncbuf *rxbuf) switch (h3s->type) { case H3S_T_QPACK_DEC: - if (!qpack_decode_dec(qcs, NULL)) + if (qpack_decode_dec(qcs, NULL)) return 1; break; case H3S_T_QPACK_ENC: - if (!qpack_decode_enc(qcs, NULL)) + if (qpack_decode_enc(qcs, NULL)) return 1; break; case H3S_T_UNKNOWN: diff --git a/src/qpack-dec.c b/src/qpack-dec.c index c5e42a0f5d..3ca2eda650 100644 --- a/src/qpack-dec.c +++ b/src/qpack-dec.c @@ -93,7 +93,10 @@ static uint64_t qpack_get_varint(const unsigned char **buf, uint64_t *len_in, in return 0; } -/* Decode an encoder stream */ +/* Decode an encoder stream. + * + * Returns 0 on success else non-zero. + */ int qpack_decode_enc(struct qcs *qcs, void *ctx) { size_t len; @@ -123,10 +126,13 @@ int qpack_decode_enc(struct qcs *qcs, void *ctx) /* Set dynamic table capacity */ } - return 1; + return 0; } -/* Decode an decoder stream */ +/* Decode an decoder stream. + * + * Returns 0 on success else non-zero. + */ int qpack_decode_dec(struct qcs *qcs, void *ctx) { size_t len; @@ -153,7 +159,7 @@ int qpack_decode_dec(struct qcs *qcs, void *ctx) /* Stream cancellation */ } - return 1; + return 0; } /* Decode a field section prefix made of and two varints.