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.
diff --git a/src/event/modules/ngx_eventport_module.c b/src/event/modules/ngx_eventport_module.c
index 5f9cf4e..860f598 100644
--- a/src/event/modules/ngx_eventport_module.c
+++ b/src/event/modules/ngx_eventport_module.c
@@ -530,6 +530,14 @@
rev = c->read;
wev = c->write;
+ if (!rev->active) {
+ revents &= ~POLLIN;
+ }
+
+ if (!wew->active) {
+ revents &= ~POLLOUT;
+ }
+
rev->active = 0;
wev->active = 0;