]> granicus.if.org Git - libevent/commitdiff
bufferevents would not correctly detect EOF on read; reported by
authorNiels Provos <provos@gmail.com>
Fri, 10 Jun 2005 07:42:14 +0000 (07:42 +0000)
committerNiels Provos <provos@gmail.com>
Fri, 10 Jun 2005 07:42:14 +0000 (07:42 +0000)
Jonathan Brannan

svn:r167

buffer.c

index afd2204569f2ce1b76ca024deaf1ad3173083b17..1dc16ae394361f136999e9934d6fd6ee7f7a4a9b 100644 (file)
--- 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)