From: Niels Provos Date: Fri, 10 Jun 2005 07:42:14 +0000 (+0000) Subject: bufferevents would not correctly detect EOF on read; reported by X-Git-Tag: release-1.1b~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81bd0a0687f1350f5d1a427ca2ed5858fcfa3af4;p=libevent bufferevents would not correctly detect EOF on read; reported by Jonathan Brannan svn:r167 --- diff --git a/buffer.c b/buffer.c index afd22045..1dc16ae3 100644 --- a/buffer.c +++ b/buffer.c @@ -332,7 +332,7 @@ evbuffer_read(struct evbuffer *buf, int fd, int howmuch) #endif #ifdef FIONREAD - if (ioctl(fd, FIONREAD, &n) == -1) + if (ioctl(fd, FIONREAD, &n) == -1 || n == 0) n = EVBUFFER_MAX_READ; #endif if (howmuch < 0 || howmuch > n)