mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
bufferevents would not correctly detect EOF on read; reported by
Jonathan Brannan svn:r167
This commit is contained in:
parent
7a0c530b56
commit
81bd0a0687
2
buffer.c
2
buffer.c
@ -332,7 +332,7 @@ evbuffer_read(struct evbuffer *buf, int fd, int howmuch)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FIONREAD
|
#ifdef FIONREAD
|
||||||
if (ioctl(fd, FIONREAD, &n) == -1)
|
if (ioctl(fd, FIONREAD, &n) == -1 || n == 0)
|
||||||
n = EVBUFFER_MAX_READ;
|
n = EVBUFFER_MAX_READ;
|
||||||
#endif
|
#endif
|
||||||
if (howmuch < 0 || howmuch > n)
|
if (howmuch < 0 || howmuch > n)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user