In live trace streaming, we can create an iterator with inactive
streams. This patch allows inactive streams to be considered as valid.
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
if (ret == EOF) {
ret = 0;
continue;
- } else if (ret) {
+ } else if (ret != 0 && ret != EAGAIN) {
goto error;
}
/* Add to heap */
removed = bt_heap_replace_max(iter->stream_heap, file_stream);
assert(removed == file_stream);
+ file_stream = bt_heap_maximum(iter->stream_heap);
+ if (file_stream->pos.content_size == 0) {
+ ret = EAGAIN;
+ } else {
+ ret = 0;
+ }
+
end:
return ret;
}