Handle packets containing only a header
authorJulien Desfossez <jdesfossez@efficios.com>
Wed, 27 Nov 2013 16:40:11 +0000 (11:40 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 27 Nov 2013 17:40:35 +0000 (12:40 -0500)
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 <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 5f263cd36e9a50bae29981ba1d9daba24920c62d..5cf8097ce709892580c49957cf4751f9bc2e753b 100644 (file)
@@ -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 */
This page took 0.025294 seconds and 4 git commands to generate.