Skip to content

Commit 71feb49

Browse files
committed
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.
1 parent ddc5f8d commit 71feb49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mux_spop.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ static int spop_conn_handle_hello(struct spop_conn *spop_conn)
16431643

16441644
/* process full record only */
16451645
if (b_data(dbuf) < (spop_conn->dfl)) {
1646+
spop_conn->flags |= SPOP_CF_DEM_SHORT_READ;
16461647
TRACE_DEVEL("leaving on missing data", SPOP_EV_RX_FRAME|SPOP_EV_RX_HELLO, spop_conn->conn);
16471648
return 0;
16481649
}
@@ -1814,6 +1815,7 @@ static int spop_conn_handle_disconnect(struct spop_conn *spop_conn)
18141815

18151816
/* process full record only */
18161817
if (b_data(dbuf) < (spop_conn->dfl)) {
1818+
spop_conn->flags |= SPOP_CF_DEM_SHORT_READ;
18171819
TRACE_DEVEL("leaving on missing data", SPOP_EV_RX_FRAME|SPOP_EV_RX_DISCO, spop_conn->conn);
18181820
return 0;
18191821
}
@@ -1925,6 +1927,7 @@ static int spop_conn_handle_ack(struct spop_conn *spop_conn, struct spop_strm *s
19251927

19261928
/* process full record only */
19271929
if (b_data(dbuf) < (spop_conn->dfl)) {
1930+
spop_conn->flags |= SPOP_CF_DEM_SHORT_READ;
19281931
TRACE_DEVEL("leaving on missing data", SPOP_EV_RX_FRAME|SPOP_EV_RX_DISCO, spop_conn->conn);
19291932
return 0;
19301933
}

0 commit comments

Comments
 (0)