int i, len;
bool found = false;
- len = bt_value_array_get_size(results);
+ len = bt_value_array_get_length(results);
if (len < 0) {
BT_COMP_LOGE_STR("Error getting size of array.");
ret = -1;
uint32_t i, sessions_count;
ssize_t ret_len;
- if (lttng_live_handshake(viewer_connection)) {
- goto error;
- }
-
result = bt_value_array_create();
if (!result) {
BT_COMP_LOGE("Error creating array");
index->offset = EOF;
retstatus = LTTNG_LIVE_ITERATOR_STATUS_END;
stream->state = LTTNG_LIVE_STREAM_EOF;
+ stream->has_stream_hung_up = true;
break;
case LTTNG_VIEWER_INDEX_ERR:
BT_COMP_LOGE("get_next_index: error");
BT_HIDDEN
struct live_viewer_connection *live_viewer_connection_create(
const char *url, bool in_query,
- struct lttng_live_msg_iter *lttng_live_msg_iter)
+ struct lttng_live_msg_iter *lttng_live_msg_iter,
+ bt_logging_level log_level)
{
struct live_viewer_connection *viewer_connection;
viewer_connection = g_new0(struct live_viewer_connection, 1);
- if (bt_socket_init(lttng_live_msg_iter->log_level) != 0) {
+ if (bt_socket_init(log_level) != 0) {
goto error;
}
- viewer_connection->log_level = lttng_live_msg_iter->log_level;
- viewer_connection->self_comp = lttng_live_msg_iter->self_comp;
+ viewer_connection->log_level = log_level;
+
+ if (lttng_live_msg_iter) {
+ viewer_connection->self_comp = lttng_live_msg_iter->self_comp;
+ }
+
bt_object_init_shared(&viewer_connection->obj, connection_release);
viewer_connection->control_sock = BT_INVALID_SOCKET;
viewer_connection->port = -1;