*/
if (unlikely(pos->offset == EOF))
return EOF;
+
+ if (pos->content_size == 0) {
+ /* Stream is inactive for now (live reading). */
+ return EAGAIN;
+ }
+ /* Packet only contains headers */
+ if (pos->offset == pos->content_size)
+ return EAGAIN;
+
assert(pos->offset < pos->content_size);
/* Read event header */