mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Fix evport handling of POLLHUP and POLLERR
In other backends, they make _all_ events trigger; with evport they previously triggered nothing. Found by Phua Keat Yee.
This commit is contained in:
parent
05f0195dd9
commit
b42ce4bf08
12
evport.c
12
evport.c
@ -336,10 +336,14 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
|
|||||||
* (because we have to pass this to the callback)
|
* (because we have to pass this to the callback)
|
||||||
*/
|
*/
|
||||||
res = 0;
|
res = 0;
|
||||||
if (pevt->portev_events & POLLIN)
|
if (pevt->portev_events & (POLLERR|POLLHUP)) {
|
||||||
res |= EV_READ;
|
res = EV_READ | EV_WRITE;
|
||||||
if (pevt->portev_events & POLLOUT)
|
} else {
|
||||||
res |= EV_WRITE;
|
if (pevt->portev_events & POLLIN)
|
||||||
|
res |= EV_READ;
|
||||||
|
if (pevt->portev_events & POLLOUT)
|
||||||
|
res |= EV_WRITE;
|
||||||
|
}
|
||||||
|
|
||||||
EVUTIL_ASSERT(epdp->ed_nevents > fd);
|
EVUTIL_ASSERT(epdp->ed_nevents > fd);
|
||||||
fdi = &(epdp->ed_fds[fd]);
|
fdi = &(epdp->ed_fds[fd]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user