ustream-fd: stop trying to read when s->read_blocked is set.
authorYousong Zhou <yszhou4tech@gmail.com>
Thu, 4 Jun 2015 13:41:42 +0000 (21:41 +0800)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 14 Jun 2015 13:16:25 +0000 (15:16 +0200)
User's s->notify_read is called in ustream_fill_read().  If
s->read_blocked is set there, then stop reading more.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
ustream-fd.c

index daef499e51429fc97a5aa53cb7383bec0a2586d6..5ffca53328858280e3a1bb51c944728b71fe38c7 100644 (file)
@@ -50,6 +50,9 @@ static void ustream_fd_read_pending(struct ustream_fd *sf, bool *more)
        char *buf;
 
        do {
+               if (s->read_blocked)
+                       break;
+
                buf = ustream_reserve(s, 1, &buflen);
                if (!buf)
                        break;