]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: htx: clarify <mark> parameter for htx_xfer_blks()
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 31 Jan 2025 14:23:47 +0000 (15:23 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 31 Jan 2025 14:23:47 +0000 (15:23 +0100)
Clarify the fact that the first <mark> block is transferred before
stopping when using htx_xfer_blks()

doc/internals/api/htx-api.txt
src/htx.c

index 62b3093f4febb7a42b99120c55b398c773bf813f..93142018e9d1e0f1c27ef6dc3edaef677ca433be 100644 (file)
@@ -540,14 +540,15 @@ message. These functions are used by HTX analyzers or by multiplexers.
       the amount of data drained.
 
     - htx_xfer_blks() transfers HTX blocks from an HTX message to another,
-      stopping on the first block of a specified type or when a specific amount
-      of bytes, including meta-data, was moved. If the tail block is a DATA
-      block, it may be partially moved. All other block are transferred at once
-      or kept. This function returns a mixed value, with the last block moved,
-      or NULL if nothing was moved, and the amount of data transferred. When
-      HEADERS or TRAILERS blocks must be transferred, this function transfers
-      all of them. Otherwise, if it is not possible, it triggers an error. It is
-      the caller responsibility to transfer all headers or trailers at once.
+      stopping after the first block of a specified type is transferred or when
+      a specific amount of bytes, including meta-data, was moved. If the tail
+      block is a DATA block, it may be partially moved. All other block are
+      transferred at once or kept. This function returns a mixed value, with the
+      last block moved, or NULL if nothing was moved, and the amount of data
+      transferred. When HEADERS or TRAILERS blocks must be transferred, this
+      function transfers all of them. Otherwise, if it is not possible, it
+      triggers an error. It is the caller responsibility to transfer all headers
+      or trailers at once.
 
     - htx_append_msg() append an HTX message to another one. All the message is
       copied or nothing. So, if an error occurred, a rollback is performed. This
index a438d7ff5de05a1392dc9f31a8c9606a9a58a3f2..105b2ad60380d74855795d15bad75f51116ac0c9 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -675,10 +675,10 @@ struct htx_blk *htx_replace_blk_value(struct htx *htx, struct htx_blk *blk,
        return blk;
 }
 
-/* Transfer HTX blocks from <src> to <dst>, stopping on the first block of the
- * type <mark> (typically EOH or EOT) or when <count> bytes were moved
- * (including payload and meta-data). It returns the number of bytes moved and
- * the last HTX block inserted in <dst>.
+/* Transfer HTX blocks from <src> to <dst>, stopping once the first block of the
+ * type <mark> is transferred (typically EOH or EOT) or when <count> bytes were
+ * moved (including payload and meta-data). It returns the number of bytes moved
+ * and the last HTX block inserted in <dst>.
  */
 struct htx_ret htx_xfer_blks(struct htx *dst, struct htx *src, uint32_t count,
                             enum htx_blk_type mark)