Fix: get the stream_id when generating live beacons
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index ac03cf846a7ec7992d7c21f9423d0af6813f22db..3a6bebaf7d6d3dc1ab5f7cf4fe76522d6f5c56fd 100644 (file)
@@ -1205,6 +1205,7 @@ int relay_add_stream(struct lttcomm_relayd_hdr *recv_hdr,
        stream->session_id = session->id;
        stream->index_fd = -1;
        stream->read_index_fd = -1;
+       stream->ctf_stream_id = -1ULL;
        lttng_ht_node_init_u64(&stream->node, stream->stream_handle);
        pthread_mutex_init(&stream->lock, NULL);
 
@@ -1963,6 +1964,9 @@ int relay_recv_index(struct lttcomm_relayd_hdr *recv_hdr,
        }
 
        copy_index_control_data(index, &index_info);
+       if (stream->ctf_stream_id == -1ULL) {
+               stream->ctf_stream_id = be64toh(index_info.stream_id);
+       }
 
        if (index_created) {
                /*
This page took 0.02291 seconds and 4 git commands to generate.