mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-15 23:35:02 -04:00
fix off by one errors in devpoll; from Ian Bell
svn:r921
This commit is contained in:
parent
3b24f4eedc
commit
1aa6826f62
@ -119,6 +119,8 @@ Changes in current version:
|
||||
o Fix a bug where deleting signals with the kqueue backend would cause subsequent adds to fail
|
||||
o Support multiple events listening on the same signal; make signals regular events that go on the same event queue; problem report by Alexander Drozdov.
|
||||
o Fix a problem with epoll() and reinit; problem report by Alexander Drozdov.
|
||||
o Fix off-by-one errors in devpoll; from Ian Bell
|
||||
|
||||
Changes in 1.4.0:
|
||||
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.
|
||||
o demote most http warnings to debug messages
|
||||
|
@ -137,7 +137,7 @@ devpoll_init(struct event_base *base)
|
||||
|
||||
if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
|
||||
rl.rlim_cur != RLIM_INFINITY)
|
||||
nfiles = rl.rlim_cur - 1;
|
||||
nfiles = rl.rlim_cur;
|
||||
|
||||
/* Initialize the kernel queue */
|
||||
if ((dpfd = open("/dev/poll", O_RDWR)) == -1) {
|
||||
@ -185,12 +185,12 @@ devpoll_recalc(struct event_base *base, void *arg, int max)
|
||||
{
|
||||
struct devpollop *devpollop = arg;
|
||||
|
||||
if (max > devpollop->nfds) {
|
||||
if (max >= devpollop->nfds) {
|
||||
struct evdevpoll *fds;
|
||||
int nfds;
|
||||
|
||||
nfds = devpollop->nfds;
|
||||
while (nfds < max)
|
||||
while (nfds <= max)
|
||||
nfds <<= 1;
|
||||
|
||||
fds = mm_realloc(devpollop->fds, nfds * sizeof(struct evdevpoll));
|
||||
|
Loading…
x
Reference in New Issue
Block a user