conn->type = RELAY_VIEWER_NOTIFICATION;
} else {
ERR("Unknown connection type : %u", be32toh(msg.type));
conn->type = RELAY_VIEWER_NOTIFICATION;
} else {
ERR("Unknown connection type : %u", be32toh(msg.type));
if (!session) {
DBG("Relay session %" PRIu64 " not found",
be64toh(request.session_id));
if (!session) {
DBG("Relay session %" PRIu64 " not found",
be64toh(request.session_id));
- ret = make_viewer_streams(session, VIEWER_SEEK_LAST, NULL, &nb_unsent,
+ ret = make_viewer_streams(session, LTTNG_VIEWER_SEEK_LAST, NULL, &nb_unsent,
if (!session) {
DBG("Relay session %" PRIu64 " not found",
be64toh(request.session_id));
if (!session) {
DBG("Relay session %" PRIu64 " not found",
be64toh(request.session_id));
* The index is created only when the first data packet arrives, it
* might not be ready at the beginning of the session
*/
* The index is created only when the first data packet arrives, it
* might not be ready at the beginning of the session
*/
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
if (rstream->tracefile_count_current == vstream->tracefile_count_current) {
if (rstream->beacon_ts_end != -1ULL &&
vstream->last_sent_index == rstream->total_index_received) {
if (rstream->tracefile_count_current == vstream->tracefile_count_current) {
if (rstream->beacon_ts_end != -1ULL &&
vstream->last_sent_index == rstream->total_index_received) {
viewer_index.timestamp_end = htobe64(rstream->beacon_ts_end);
pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
goto send_reply;
viewer_index.timestamp_end = htobe64(rstream->beacon_ts_end);
pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
goto send_reply;
*/
pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
/* No new index to send, retry later. */
*/
pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
/* No new index to send, retry later. */
} else if (rstream->close_flag && vstream->close_write_flag &&
vstream->total_index_received == vstream->last_sent_index) {
/* Last index sent and current tracefile closed in write */
} else if (rstream->close_flag && vstream->close_write_flag &&
vstream->total_index_received == vstream->last_sent_index) {
/* Last index sent and current tracefile closed in write */
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
pthread_mutex_unlock(&vstream->overwrite_lock);
ret = viewer_stream_rotate(vstream, rstream);
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
pthread_mutex_unlock(&vstream->overwrite_lock);
ret = viewer_stream_rotate(vstream, rstream);
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
* The tracefile is closed in write, so we read up to EOF.
*/
if (vstream->close_write_flag == 1) {
* The tracefile is closed in write, so we read up to EOF.
*/
if (vstream->close_write_flag == 1) {
/* Rotate on normal EOF */
ret = viewer_stream_rotate(vstream, rstream);
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
/* Rotate on normal EOF */
ret = viewer_stream_rotate(vstream, rstream);
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
}
} else {
PERROR("Relay reading index file %d", vstream->index_read_fd);
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
}
} else {
PERROR("Relay reading index file %d", vstream->index_read_fd);