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;
ret = -1;
goto end;
}
- val = bt_value_integer_signed_get(btval);
+ val = bt_value_integer_unsigned_get(btval);
/* sum */
val += streams;
- bt_value_integer_signed_set(btval, val);
+ bt_value_integer_unsigned_set(btval, val);
btval = bt_value_map_borrow_entry_value(map, "client-count");
if (!btval) {
ret = -1;
goto end;
}
- val = bt_value_integer_signed_get(btval);
+ val = bt_value_integer_unsigned_get(btval);
/* max */
val = bt_max_t(int64_t, clients, val);
- bt_value_integer_signed_set(btval, val);
+ bt_value_integer_unsigned_set(btval, val);
}
if (found) {
{
uint32_t live_timer = be32toh(session->live_timer);
- insert_status = bt_value_map_insert_signed_integer_entry(
+ insert_status = bt_value_map_insert_unsigned_integer_entry(
map, "timer-us", live_timer);
if (insert_status != BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK) {
BT_COMP_LOGE_STR("Error inserting \"timer-us\" entry.");
{
uint32_t streams = be32toh(session->streams);
- insert_status = bt_value_map_insert_signed_integer_entry(map,
+ insert_status = bt_value_map_insert_unsigned_integer_entry(map,
"stream-count", streams);
if (insert_status != BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK) {
BT_COMP_LOGE_STR("Error inserting \"stream-count\" entry.");
{
uint32_t clients = be32toh(session->clients);
- insert_status = bt_value_map_insert_signed_integer_entry(map,
+ insert_status = bt_value_map_insert_unsigned_integer_entry(map,
"client-count", clients);
if (insert_status != BT_VALUE_MAP_INSERT_ENTRY_STATUS_OK) {
BT_COMP_LOGE_STR("Error inserting \"client-count\" entry.");
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");
error_report:
BT_COMP_LOGW("Failure to establish connection to url \"%s\"", url);
error:
- g_free(viewer_connection);
+ if (viewer_connection) {
+ live_viewer_connection_destroy(viewer_connection);
+ }
+
return NULL;
}
{
BT_COMP_LOGI("Closing connection to url \"%s\"", viewer_connection->url->str);
lttng_live_disconnect_viewer(viewer_connection);
- g_string_free(viewer_connection->url, true);
+ if (viewer_connection->url) {
+ g_string_free(viewer_connection->url, true);
+ }
if (viewer_connection->relay_hostname) {
g_string_free(viewer_connection->relay_hostname, true);
}