ctf: assert that request_sz in medium ops request_bytes is greater than 0
[babeltrace.git] / src / plugins / ctf / lttng-live / data-stream.c
index 6414805351deb4157ce66280ee60be2993b3cbfb..3435628754de16d1810509181281247dd7700cb7 100644 (file)
@@ -58,6 +58,8 @@ enum ctf_msg_iter_medium_status medop_request_bytes(
        uint64_t len_left;
        uint64_t read_len;
 
+       BT_ASSERT(request_sz);
+
        if (stream->has_stream_hung_up) {
                status = CTF_MSG_ITER_MEDIUM_STATUS_EOF;
                goto end;
@@ -230,7 +232,7 @@ struct lttng_live_stream_iterator *lttng_live_stream_iterator_create(
 
        stream_iter->log_level = log_level;
        stream_iter->self_comp = self_comp;
-       trace = lttng_live_borrow_trace(session, ctf_trace_id);
+       trace = lttng_live_session_borrow_or_create_trace_by_id(session, ctf_trace_id);
        if (!trace) {
                BT_COMP_LOGE_APPEND_CAUSE(self_comp,
                        "Failed to borrow CTF trace.");
@@ -317,10 +319,5 @@ void lttng_live_stream_iterator_destroy(
        /* Track the number of active stream iterator. */
        stream_iter->trace->session->lttng_live_msg_iter->active_stream_iter--;
 
-       /*
-        * Ensure we poke the trace metadata in the future, which is
-        * required to release the metadata reference on the trace.
-        */
-       stream_iter->trace->new_metadata_needed = true;
        g_free(stream_iter);
 }
This page took 0.025025 seconds and 4 git commands to generate.