BUG/MEDIUM: mux-spop: Remove frame parsing states from the SPOP connection state
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 13 May 2025 16:55:32 +0000 (18:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:44 +0000 (17:01 +0200)
commitd55a5662c362d636fb325d7a46851a3a0cb753d1
tree4f3157603aed3d304e06d5078f1a36fb66513bfc
parent6b9a360b7ad9688078d7ba0fcfdd6626cc82669d
BUG/MEDIUM: mux-spop: Remove frame parsing states from the SPOP connection state

SPOP_CS_FRAME_H and SPOP_CS_FRAME_P states, that were used to handle frame
parsing, were removed. The demux process now relies on the demux stream ID
to know if it is waiting for the frame header or the frame
payload. Concretly, when the demux stream ID is not set (dsi == -1), the
demuxer is waiting for the next frame header. Otherwise (dsi >= 0), it is
waiting for the frame payload. It is especially important to be able to
properly handle DISCONNECT frames sent by the agents.

SPOP_CS_RUNNING state is introduced to know the hello handshake was finished
and the SPOP connection is able to open SPOP streams and exchange NOTIFY/ACK
frames with the agents.

It depends on the following fixes:

  * MINOR: mux-spop: Don't set SPOP connection state to FRAME_H after ACK parsing
  * BUG/MINOR: mux-spop: Make the demux stream ID a signed integer

This change will be mandatory for the next fix. It must be backported to 3.1
with the commits above.

(cherry picked from commit a3940614c24049d2c1ee9f686e0579e3a2e49b33)
[wt: adj ctx WRT tevt which is absent from 3.1
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/mux_spop-t.h
src/mux_spop.c