#include "live.h"
#include "health-relayd.h"
#include "testpoint.h"
+#include "viewer-stream.h"
/* command line options */
char *opt_output_path;
}
}
- vstream = live_find_viewer_stream_by_id(stream->stream_handle);
+ vstream = viewer_stream_find_by_id(stream->stream_handle);
if (vstream) {
/*
* Set the last good value into the viewer stream. This is done
session->sock = cmd->sock;
session->minor = cmd->minor;
session->major = cmd->major;
+ pthread_mutex_init(&session->viewer_ready_lock, NULL);
cmd->session = session;
reply.session_id = htobe64(session->id);
{
struct relay_stream_recv_handle *node, *tmp_node;
+ pthread_mutex_lock(&cmd->session->viewer_ready_lock);
+
cds_list_for_each_entry_safe(node, tmp_node, &cmd->recv_head, node) {
struct relay_stream *stream;
free(node);
}
+ pthread_mutex_unlock(&cmd->session->viewer_ready_lock);
return;
}
*/
set_viewer_ready_flag(cmd);
+ /*
+ * Inform the viewer that there are new streams in the session.
+ */
+ uatomic_set(&cmd->session->new_streams, 1);
+
reply.ret_code = htobe32(LTTNG_OK);
send_ret = cmd->sock->ops->sendmsg(cmd->sock, &reply, sizeof(reply), 0);
if (send_ret < 0) {
(stream->oldest_tracefile_id + 1) %
stream->tracefile_count;
}
- vstream = live_find_viewer_stream_by_id(stream->stream_handle);
+ vstream = viewer_stream_find_by_id(stream->stream_handle);
if (vstream) {
/*
* The viewer is reading a file about to be