From mboxrd@z Thu Jan 1 00:00:00 1970 From: jdesfossez@efficios.com (Julien Desfossez) Date: Wed, 27 Nov 2013 11:40:11 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 2/3] Handle packets containing only a header In-Reply-To: <1385570412-31370-1-git-send-email-jdesfossez@efficios.com> References: <1385570412-31370-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1385570412-31370-2-git-send-email-jdesfossez@efficios.com> In live streaming with LTTng, if we do a stop and then a destroy, we receive a packet that contains only a header. With this patch, we will ask for a new packet when we see this case. Signed-off-by: Julien Desfossez --- formats/ctf/ctf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 5f263cd..5cf8097 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -476,6 +476,10 @@ int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *str /* Stream is inactive for now (live reading). */ return EAGAIN; } + /* Packet only contains headers */ + if (pos->offset == pos->content_size) + return EAGAIN; + assert(pos->offset < pos->content_size); /* Read event header */ -- 1.8.3.2