]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: h3: fix documentation of h3_rcv_buf()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Feb 2025 10:28:07 +0000 (11:28 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Feb 2025 16:31:40 +0000 (17:31 +0100)
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().

src/h3.c

index b57916b109b46c755e0086e15bcddc36e4e74f8f..20023403e9760a7b938837511e60d7e6eef6203e 100644 (file)
--- 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 <b> to HTX data for stream
  * <qcs>. If <fin> 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)
 {