Currently, the "HUP" reply (hung up) is only sent when a session destroy
is performed and all data has been sent. However, with per-pid buffers,
application can come and go during the tracing session, so we need to
send the HUP reply for each individual stream that is gone.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
{
int ret;
- if (trace->session->connection_closed
+ if ((trace->session->connection_closed || rstream->closed)
&& rstream->index_received_seqcount
== vstream->index_sent_seqcount) {
- /* Last index sent and session connection is closed. */
+ /*
+ * Last index sent and session connection or relay
+ * stream are closed.
+ */
index->status = htobe32(LTTNG_VIEWER_INDEX_HUP);
goto hup;
} else if (rstream->beacon_ts_end != -1ULL &&