From 70de0e1bb0858e20942323b2fd5907f47e197b50 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 27 Feb 2025 11:28:07 +0100 Subject: [PATCH] CLEANUP: h3: fix documentation of h3_rcv_buf() Return value of h3_rcv_buf() is incorrectly documented. Indeed, it may return a positive value to indicate that input bytes were converted into HTX. This is especially important, as caller uses this value to consume the reported data amount in QCS Rx buffer. This should be backported up to 2.6. Note that on 2.8, h3_rcv_buf() was named h3_decode_qcs(). (cherry picked from commit 0aa35289b3b51e09a5757c9991212ec416d281f2) Signed-off-by: Christopher Faulet (cherry picked from commit da6832fd2fb065cb32f030609b53fee87488aab7) Signed-off-by: Amaury Denoyelle --- src/h3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/h3.c b/src/h3.c index e68271c..9ecb95d 100644 --- a/src/h3.c +++ b/src/h3.c @@ -1270,7 +1270,9 @@ static ssize_t h3_parse_settings_frm(struct h3c *h3c, const struct buffer *buf, /* Transcode HTTP/3 payload received in buffer to HTX data for stream * . If is set, it indicates that no more data will arrive after. * - * Returns 0 on success else non-zero. + * Returns the count of consumed bytes or a negative error code. If 0 is + * returned, stream data is incomplete, decoding should be call again later + * with more content. */ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) { -- 1.7.10.4