+ /*
+ * A removed node from the hash table indicates that the stream has
+ * been deleted thus having a guarantee that the buffers are closed
+ * on the consumer side. However, data can still be transmitted
+ * over the network so don't skip the relayd check.
+ */
+ ret = cds_lfht_is_node_deleted(&stream->node.node);
+ if (!ret) {
+ /* Check the stream if there is data in the buffers. */
+ ret = data_available(stream);
+ if (ret == 0) {
+ pthread_mutex_unlock(&stream->lock);
+ goto data_not_available;
+ }
+ }
+
+ /* Relayd check */