From: Christopher Faulet Date: Wed, 14 May 2025 07:20:08 +0000 (+0200) Subject: BUG/MEDIUM: spop-conn: Report short read for partial frames payload X-Git-Tag: v3.1.8~35 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=be20d5e319b7c22bec85a70777ed616934fc7aa9;p=haproxy-3.1.git BUG/MEDIUM: spop-conn: Report short read for partial frames payload When a frame was not fully received, a short read must be reported on the SPOP connection to help the demux to handle truncated frames. This was performed for frames truncated on the header part but not on the payload part. It is now properly detected. This patch must be backported to 3.1. (cherry picked from commit 71feb49a9f0ef1142970fca98ca8eebd516928a3) Signed-off-by: Willy Tarreau --- diff --git a/src/mux_spop.c b/src/mux_spop.c index 6a30f72..e1d20d1 100644 --- a/src/mux_spop.c +++ b/src/mux_spop.c @@ -1587,6 +1587,7 @@ static int spop_conn_handle_hello(struct spop_conn *spop_conn) /* process full record only */ if (b_data(dbuf) < (spop_conn->dfl)) { + spop_conn->flags |= SPOP_CF_DEM_SHORT_READ; TRACE_DEVEL("leaving on missing data", SPOP_EV_RX_FRAME|SPOP_EV_RX_HELLO, spop_conn->conn); return 0; } @@ -1758,6 +1759,7 @@ static int spop_conn_handle_disconnect(struct spop_conn *spop_conn) /* process full record only */ if (b_data(dbuf) < (spop_conn->dfl)) { + spop_conn->flags |= SPOP_CF_DEM_SHORT_READ; TRACE_DEVEL("leaving on missing data", SPOP_EV_RX_FRAME|SPOP_EV_RX_DISCO, spop_conn->conn); return 0; } @@ -1868,6 +1870,7 @@ static int spop_conn_handle_ack(struct spop_conn *spop_conn, struct spop_strm *s /* process full record only */ if (b_data(dbuf) < (spop_conn->dfl)) { + spop_conn->flags |= SPOP_CF_DEM_SHORT_READ; TRACE_DEVEL("leaving on missing data", SPOP_EV_RX_FRAME|SPOP_EV_RX_DISCO, spop_conn->conn); return 0; }