From: Julien Desfossez Date: Wed, 27 Nov 2013 16:40:11 +0000 (-0500) Subject: Handle packets containing only a header X-Git-Tag: v1.2.0-rc1~39^2~6 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=a52600470ad14e59cba2e17de3df3f3f336b1adb Handle packets containing only a header 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 5f263cd3..5cf8097c 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 */