BUG/MEDIUM: mux-spop: Properly handle CLOSING state
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 13 May 2025 17:04:01 +0000 (19:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:44 +0000 (17:01 +0200)
commit853b79d6f3b4459c021ff440540b84ce836a3a7c
tree72dfd7e5e8a378511319b73627ee7b1194f6f30f
parentd55a5662c362d636fb325d7a46851a3a0cb753d1
BUG/MEDIUM: mux-spop: Properly handle CLOSING state

The CLOSING state was not handled at all by the SPOP multiplexer while it is
mandatory when a DISCONNECT frame was sent and the mux should wait for the
DISCONNECT frame in reply from the agent. Thanks to this patch, it should be
fixed.

In addition, if an error occurres during the AGENT HELLO frame parsing, the
SPOP connection is no longer switched to CLOSED state and remains in ERROR
state instead. It is important to be able to send the DISCONNECT frame to
the agent instead of closing the TCP connection immediately.

This patch depends on following commits:

  * BUG/MEDIUM: mux-spop: Remove frame parsing states from the SPOP connection state
  * MINOR: mux-spop: Don't set SPOP connection state to FRAME_H after ACK parsing
  * BUG/MINOR: mux-spop: Don't open new streams for SPOP connection on error
  * BUG/MINOR: mux-spop: Make the demux stream ID a signed integer

All the series must be backported to 3.1.

(cherry picked from commit ddc5f8d92e3613ec7060b0ee8bdb220866182e86)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_spop.c