Mercurial > hg > nginx
comparison src/event/modules/ngx_epoll_module.c @ 4430:e99e429947f9 stable-1.0
Merge of r4306, r4320:
Protection from stale write events in epoll.
Stale write event may happen if epoll_wait() reported both read and write
events, and processing of the read event closed descriptor.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 04 Feb 2012 23:18:12 +0000 |
parents | c48662671609 |
children | 4919fb357a5d |
comparison
equal
deleted
inserted
replaced
4429:2d235c76c59e | 4430:e99e429947f9 |
---|---|
681 | 681 |
682 wev = c->write; | 682 wev = c->write; |
683 | 683 |
684 if ((revents & EPOLLOUT) && wev->active) { | 684 if ((revents & EPOLLOUT) && wev->active) { |
685 | 685 |
686 if (c->fd == -1 || wev->instance != instance) { | |
687 | |
688 /* | |
689 * the stale event from a file descriptor | |
690 * that was just closed in this iteration | |
691 */ | |
692 | |
693 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | |
694 "epoll: stale event %p", c); | |
695 continue; | |
696 } | |
697 | |
686 if (flags & NGX_POST_THREAD_EVENTS) { | 698 if (flags & NGX_POST_THREAD_EVENTS) { |
687 wev->posted_ready = 1; | 699 wev->posted_ready = 1; |
688 | 700 |
689 } else { | 701 } else { |
690 wev->ready = 1; | 702 wev->ready = 1; |