Fix format 3 handling for new messages with the same delta and other params

This commit is contained in:
Muaz Ahmad 2023-08-15 15:55:11 +05:00
parent 56b6c2ff69
commit b0239ed761

View file

@ -265,7 +265,18 @@ func ReadChunk(conn net.Conn, open_chnkstrms map[uint32]*ChunkStream, open_msgs
} }
case 3: case 3:
chnkstream_ptr = open_chnkstrms[csid] chnkstream_ptr = open_chnkstrms[csid]
msg_ptr = open_msgs[chnkstream_ptr.last_msg_strm_id] msg_prev, ok := open_msgs[chnkstream_ptr.last_msg_strm_id]
if !ok {
msg_ptr = new(Message)
msg_ptr.msg_type = chnkstream_ptr.last_msg_type
msg_ptr.msg_len = chnkstream_ptr.last_msg_len
msg_ptr.data = make([]byte, msg_ptr.msg_len)
chnkstream_ptr.timestamp += chnkstream_ptr.timedelta
msg_ptr.timestamp = chnkstream_ptr.timestamp
} else {
msg_ptr = msg_prev
}
} }
n, err := read_chunk_data(conn, msg_ptr, chnk_size) n, err := read_chunk_data(conn, msg_ptr, chnk_size)