Skip to content

Commit 5be3a8b

Browse files
author
vbart
committed
Events: handle only active events in eventport.
We generate both read and write events if an error event was returned by port_getn() without POLLIN/POLLOUT, but we should not try to handle inactive events, they may even have no handler.
1 parent 1a5a80b commit 5be3a8b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/event/modules/ngx_eventport_module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,14 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
530530
rev = c->read;
531531
wev = c->write;
532532

533+
if (!rev->active) {
534+
revents &= ~POLLIN;
535+
}
536+
537+
if (!wew->active) {
538+
revents &= ~POLLOUT;
539+
}
540+
533541
rev->active = 0;
534542
wev->active = 0;
535543

0 commit comments

Comments
 (0)