X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Flive.c;h=9503ba470b70cd496291ec612f304c45446661d5;hb=ea6bf30f3684cf71633cb9f2c70ea0bc22b664c4;hp=6f50afc6cc6b1e2d2b48687cbf325521700b2392;hpb=9b9f9f94821c0f12430f3998597568e6ad0b5a6a;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 6f50afc6c..9503ba470 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -358,7 +358,7 @@ int make_viewer_streams(struct relay_session *session, } } else { if (!stream->closed || - !(((int64_t) (stream->prev_seq - stream->last_net_seq_num)) >= 0)) { + !(((int64_t) (stream->prev_data_seq - stream->last_net_seq_num)) >= 0)) { (*nb_total)++; } @@ -543,11 +543,6 @@ restart: revents = LTTNG_POLL_GETEV(&events, i); pollfd = LTTNG_POLL_GETFD(&events, i); - if (!revents) { - /* No activity for this FD (poll implementation). */ - continue; - } - /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); if (ret) { @@ -835,6 +830,11 @@ int viewer_list_sessions(struct relay_connection *conn) health_code_update(); + if (session->connection_closed) { + /* Skip closed session */ + continue; + } + if (count >= buf_count) { struct lttng_viewer_session *newbuf; uint32_t new_buf_count = buf_count << 1; @@ -1089,7 +1089,7 @@ int viewer_attach_session(struct relay_connection *conn) if (closed) { send_streams = 0; response.streams_count = 0; - response.status = htobe32(LTTNG_VIEWER_NEW_STREAMS_HUP); + response.status = htobe32(LTTNG_VIEWER_ATTACH_UNK); goto send_reply; } @@ -1995,11 +1995,6 @@ restart: health_code_update(); - if (!revents) { - /* No activity for this FD (poll implementation). */ - continue; - } - /* Thread quit pipe has been closed. Killing thread. */ ret = check_thread_quit_pipe(pollfd, revents); if (ret) {