X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=ustream.h;h=6431744155f810f5c8d2b8d3a4b57c47de60e490;hp=15f1ba10e8d7430271d071d9c3fa2f4e870f67ef;hb=13b5c1d4ca488575ee3dd4726b669f768fad8ffa;hpb=7a117988d9f75c7ccf7eeca7b59e61a4b5b5c3e4 diff --git a/ustream.h b/ustream.h index 15f1ba1..6431744 100644 --- a/ustream.h +++ b/ustream.h @@ -171,7 +171,9 @@ static inline int ustream_pending_data(struct ustream *s, bool write) static inline bool ustream_read_buf_full(struct ustream *s) { - return ustream_pending_data(s, false) == s->r.buffer_len; + struct ustream_buf *buf = s->r.data_tail; + return buf && buf->data == buf->head && buf->tail == buf->end && + s->r.buffers == s->r.max_buffers; } /*** --- functions only used by ustream implementations --- ***/