aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2013-04-12 15:04:23 +0000
committerValentin Bartenev <vbart@nginx.com>2013-04-12 15:04:23 +0000
commitc6aebf6c7411c5d43bd63cf61db08a1ec914dc5c (patch)
tree7907854ab7dc45d5d4a5ea6db907f556793797d5 /src
parented9f87c90119832c3c96fb9c352e53db61943fe4 (diff)
downloadnginx-c6aebf6c7411c5d43bd63cf61db08a1ec914dc5c.tar.gz
nginx-c6aebf6c7411c5d43bd63cf61db08a1ec914dc5c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/event/modules/ngx_eventport_module.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/event/modules/ngx_eventport_module.c b/src/event/modules/ngx_eventport_module.c
index 5f9cf4e35..860f5985c 100644
--- 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 *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;