when EPOLLIN and EPOLLOUT returned

yurnerola at gmail.com yurnerola at gmail.com
Mon Jul 29 06:29:54 UTC 2013


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...



yurnerola at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130729/dd116284/attachment.html>


More information about the nginx-devel mailing list