{
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 &&