sock: set the right epoll events on AFD_POLL_DISCONNECT

This commit is contained in:
Bert Belder 2017-11-23 02:29:54 +01:00
parent 742cc8c7fa
commit 2a7c6ded9e

View File

@ -49,6 +49,8 @@ static DWORD _epoll_events_to_afd_events(uint32_t epoll_events) {
afd_events |= AFD_POLL_RECEIVE_EXPEDITED;
if (epoll_events & (EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND))
afd_events |= AFD_POLL_SEND | AFD_POLL_CONNECT;
if (epoll_events & (EPOLLIN | EPOLLRDNORM | EPOLLRDHUP))
afd_events |= AFD_POLL_DISCONNECT;
return afd_events;
}
@ -62,8 +64,8 @@ static uint32_t _afd_events_to_epoll_events(DWORD afd_events) {
epoll_events |= EPOLLPRI | EPOLLRDBAND;
if (afd_events & (AFD_POLL_SEND | AFD_POLL_CONNECT))
epoll_events |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
if ((afd_events & AFD_POLL_DISCONNECT) && !(afd_events & AFD_POLL_ABORT))
epoll_events |= EPOLLIN | EPOLLRDHUP;
if (afd_events & AFD_POLL_DISCONNECT)
epoll_events |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
if (afd_events & AFD_POLL_ABORT)
epoll_events |= EPOLLHUP;
if (afd_events & AFD_POLL_CONNECT_FAIL)