htx_truncate() removes all blocks after the one containing the given
offset, and truncates this last one if it is a DATA block. But the
truncated block kept its flags, including HTX_BLK_FL_EOM. So a message
truncated in the middle of its last DATA block was still considered as
complete.
Now, the EOM flag is removed from the truncated block.
This patch must be backported to 3.5.
blk = htxret.blk;
if (blk && htxret.ret && htx_is_data_type(htx_get_blk_type(blk))) {
+ /* The block is truncated, so it cannot carry the EOM flag
+ * anymore: the message is not complete.
+ */
htx_change_blk_value_len(htx, blk, htxret.ret);
+ blk->flags &= ~HTX_BLK_FL_EOM;
blk = htx_get_next_blk(htx, blk);
}
while (blk)