]> git.kaiwu.me - haproxy.git/commit
MEDIUM: htx: Add htx_xfer function to replace htx_xfer_blks
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Mar 2026 07:50:42 +0000 (08:50 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 23 Mar 2026 13:02:42 +0000 (14:02 +0100)
commit5ead611cc2bf9cc851dd0264c346c261b1af7d06
treed77180886d0352d9fcdc941b8e7a07e81b4ceb24
parent41c89e4fb6b118af29c73a748f1cd78d9d338655
MEDIUM: htx: Add htx_xfer function to replace htx_xfer_blks

htx_xfer() function should replace htx_xfer_blks(). It will be a bit easier to
maintain and to use. The behavior of htx_xfer() can be changed by calling it
with specific flags:

  * HTX_XFER_KEEP_SRC_BLKS: Blocks from the source message are just copied
  * HTX_XFER_PARTIAL_HDRS_COPY: It is allowed to partially xfer headers or trailers
  * HTX_XFER_HDRS_ONLY: only headers are xferred

By default (HTX_XFER_DEFAULT or 0), all blocks from the source message are moved
into to the destination mesage. So copied in the destination messageand removed
from the source message.

The caller must still define the maximum amount of data (including meta-data)
that can be xferred.

It is no longer necessary to specify a block type to stop the copy. Most of
time, with htx_xfer_blks(), this parameter was set to HTX_BLK_UNUSED. And
otherwise it was only specified to transfer headers.

It is important to not that the caller is responsible to verify the original
HTX message is well-formated. Especially, it must be sure headers part and
trailers part are complete (finished by EOH/EOT block).

For now, htx_xfer_blks() is not removed for compatiblity reason. But it is
deprecated.
doc/internals/api/htx-api.txt
include/haproxy/htx.h
src/htx.c