when EPOLLIN and EPOLLOUT returned
Maxim Dounin
mdounin at mdounin.ru
Mon Jul 29 13:16:29 UTC 2013
Hello!
On Mon, Jul 29, 2013 at 02:29:54PM +0800, yurnerola at gmail.com wrote:
> Hi,all
> I find it hard to understand in function ngx_epoll_process_events as following.
> if ((revents & (EPOLLERR|EPOLLHUP))
> && (revents & (EPOLLIN|EPOLLOUT)) == 0)
> {
> /*
> * if the error events were returned without EPOLLIN or EPOLLOUT,
> * then add these flags to handle the events at least in one
> * active handler
> */
>
> revents |= EPOLLIN|EPOLLOUT;
> }
> As the comment said we should check if ((revents & (EPOLLERR|EPOLLHUP))==0) that we can end the connection when EPOLLERR and EPOLLHUP is returned.
> ,but why not this? Help...
Sorry, but I failed to understand your question, and likely others
failed too. It might be a good idea to clarify what do you want
to know.
--
Maxim Dounin
http://nginx.org/en/donation.html
More information about the nginx-devel
mailing list