bufferevents would not correctly detect EOF on read; reported by

Jonathan Brannan


svn:r167
This commit is contained in:
Niels Provos 2005-06-10 07:42:14 +00:00
parent 7a0c530b56
commit 81bd0a0687

View File

@ -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)