]> git.kaiwu.me - nginx.git/commitdiff
Events: handle only active events in eventport.
authorValentin Bartenev <vbart@nginx.com>
Fri, 12 Apr 2013 15:04:23 +0000 (15:04 +0000)
committerValentin Bartenev <vbart@nginx.com>
Fri, 12 Apr 2013 15:04:23 +0000 (15:04 +0000)
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.

src/event/modules/ngx_eventport_module.c

index 5f9cf4e35fbabacfa020436b52d867b2544523f6..860f5985c5d9acd3f1a1e5ce0e83208fdf4cb9d4 100644 (file)
@@ -530,6 +530,14 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
             rev = c->read;
             wev = c->write;
 
+            if (!rev->active) {
+                revents &= ~POLLIN;
+            }
+
+            if (!wew->active) {
+                revents &= ~POLLOUT;
+            }
+
             rev->active = 0;
             wev->active = 0;