]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ncbuf: complete doc for ncb_advance()
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 18 Nov 2022 14:54:40 +0000 (15:54 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 18 Nov 2022 15:44:46 +0000 (16:44 +0100)
ncb_advance() operation may reject the operation if a too small gap is
formed in buffer front. This must be documented to avoid an issue with
it.

This should be backported up to 2.6.

src/ncbuf.c

index 120293944d3a96f59cf8703676c10b5eadf20829..ed1878bf8138a3d78d97efe80717962c377e4aca 100644 (file)
@@ -625,7 +625,9 @@ enum ncb_ret ncb_add(struct ncbuf *buf, ncb_sz_t off,
  * will be lost while some space will be formed at the end to be able to insert
  * new data.
  *
- * Returns NCB_RET_OK on success.
+ * Returns NCB_RET_OK on success. It may return NCB_RET_GAP_SIZE if operation
+ * is rejected due to the formation of a too small gap in front. If advance is
+ * done only inside a data block it is guaranteed to succeed.
  */
 enum ncb_ret ncb_advance(struct ncbuf *buf, ncb_sz_t adv)
 {