Fix: src.ctf.lttng-live: decode metadata even on _STATUS_CLOSED
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 7 Nov 2019 20:42:19 +0000 (15:42 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 15 Nov 2019 17:28:24 +0000 (12:28 -0500)
commit76bbaebcbc68c8765517a3db2c293fad83a5d162
treecd26fd360bc41b6fc0afccf4c4ae2693a2f7c2e2
parent0ca5c4f9df6778d16a0dc3f74f7d3e256934058f
Fix: src.ctf.lttng-live: decode metadata even on _STATUS_CLOSED

When receiving a _GET_ONE_METADATA_STATUS_CLOSED from the
`lttng_live_get_one_metadata_packet()` function it means that the
metadata stream was closed by the relay and we will no longer get any
new metadata. But, it also means that everything we received so far is
valid and can be decoded.

So rather than returning _LIVE_ITERATOR_STATUS_END the right thing to do
is to go on with the decoding of the metadata packets.

Also did the following cleanups:
  * Merge the `lttng_live_metadata::trace` and
  `lttng_live_trace::new_metadata_needed` into a new tri-state enum
  `lttng_live_metadata_stream_state` in the `lttng_live_trace` struct.
  Those two fields were tightly linked and it's simpler to have a single
  field.

  * Remove the "poking of the trace metadata" using the
  `new_metadata_needed` as it's no longer necessary since all references
  are now borrowed.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I3e18365d5cfeaa77935409bdfe8fdda52fa5b636
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2351
src/plugins/ctf/lttng-live/data-stream.c
src/plugins/ctf/lttng-live/lttng-live.c
src/plugins/ctf/lttng-live/lttng-live.h
src/plugins/ctf/lttng-live/metadata.c
src/plugins/ctf/lttng-live/viewer-connection.c
This page took 0.024539 seconds and 4 git commands to generate.