]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: mux-quic: clean up zero-copy done_ff callback
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 2 Dec 2024 15:24:45 +0000 (16:24 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 5 Dec 2024 15:57:31 +0000 (16:57 +0100)
commit7885a3b3e159323ae3e67f7bbfb4567f2031dc9e
treed9cd8b5566069e0afa8ea36e45a8db2785957314
parentd649278fce9729415b31e873a3b91d6d0b259d16
MINOR: mux-quic: clean up zero-copy done_ff callback

Recently, an issue was found with QUIC zero-copy forwarding on 3.0
version. A desynchronization could occur internally in QCS Tx bytes
counters which would cause a BUG_ON() crash on qcs_destroy() when the
stream is detached.

It was silently fixed in version 3.1 by the following patch. As it was
considered as an optimization, it was not scheduled yet for backport.

  6697e87ae5e1f569dc87cf690b5ecfc049c4aab0
  MINOR: mux-quic: Don't send an emtpy H3 DATA frame during zero-copy forwarding

This mistake has been caused due to some counter-intuitive manipulation
in QUIC zero-copy implementation. Try to streamline this in QUIC MUX
done_ff callback and its application protocol counterpart. Especially
for values exchanged between MUX and application on one side, and MUX
and stconn layer as done_fastfwd return value.

First, application done_ff callback now returns the length of the wholly
encoded frame. For HTTP/3, it means header length + payload length h3
frame. This value can then be reused as qcc_send_stream() argument to
increase QCS Tx soft offset.

As previously, special care has been taken to ensure that QUIC MUX
done_ff only return the transferred data bytes. Thus, any extra offset
for HTTP/3 header is properly excluded. This is mandatory for stconn
layer to consider the transfer has completed.

Secondly, remove duplicated code in application done_ff to reset iobuf
info. This is now factorize in QUIC MUX done_ff itself.

This patch is related to github issue #2678.
src/h3.c
src/hq_interop.c
src/mux_quic.c