BUG/MINOR: mux-h1: Fix condition to set EOI on SE during zero-copy forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 2 Oct 2024 07:25:28 +0000 (09:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 2 Oct 2024 08:35:14 +0000 (10:35 +0200)
commitf4441c88053b0ee7cd509eedd17f9208136522b4
tree564c54ee7d7aa721b34cdbb4e33ac1891e6706fc
parentc8cde774679a43ccb6229b4ac48dad7f644b61a1
BUG/MINOR: mux-h1: Fix condition to set EOI on SE during zero-copy forwarding

During zero-copy data forwarding, the producer must set the EOI flag on the SE
when end of the message is reached. It is already done but there is a case where
this flag is set while it should not. When a request wants to perform a protocol
upgrade and it is waiting for the server response, the flag must not be set
because the HTTP message is finished but some data are possibly still expected,
depending on the server response. On a 101-switching-protocol, more data will be
sent because the producer is switch to TUNNEL state.

So, now, the right condition is used. In DONE state, SE_FL_EOI flag is set on the sedesc iff:

  - it is the response
  - it is the request and the response is also in DONNE state
  - it is a request but no a protocol upgrade nor a CONNECT

This patch must be backported as far as 2.9.

(cherry picked from commit 6b39e245e1d58698310fbb06b8122423232be9a4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_h1.c