changeset 5171:98cbd8f92c87

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.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 12 Apr 2013 15:04:23 +0000
parents 6362bd26e4b0
children a4d21534cbf4
files src/event/modules/ngx_eventport_module.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/modules/ngx_eventport_module.c
+++ b/src/event/modules/ngx_eventport_module.c
@@ -530,6 +530,14 @@ ngx_eventport_process_events(ngx_cycle_t
             rev = c->read;
             wev = c->write;
 
+            if (!rev->active) {
+                revents &= ~POLLIN;
+            }
+
+            if (!wew->active) {
+                revents &= ~POLLOUT;
+            }
+
             rev->active = 0;
             wev->active = 0;