sock: fix EPOLLOUT always reported for outgoing connections
This fixes a bug that caused a socket to be always reported writable after an outgoing connection was successfully established.
This commit is contained in:
parent
a9e78ad9b5
commit
8b7b340610
@ -13,7 +13,6 @@
|
||||
#define AFD_POLL_DISCONNECT 0x0008
|
||||
#define AFD_POLL_ABORT 0x0010
|
||||
#define AFD_POLL_LOCAL_CLOSE 0x0020
|
||||
#define AFD_POLL_CONNECT 0x0040
|
||||
#define AFD_POLL_ACCEPT 0x0080
|
||||
#define AFD_POLL_CONNECT_FAIL 0x0100
|
||||
/* clang-format on */
|
||||
|
||||
@ -167,7 +167,7 @@ static inline DWORD sock__epoll_events_to_afd_events(uint32_t epoll_events) {
|
||||
if (epoll_events & (EPOLLPRI | EPOLLRDBAND))
|
||||
afd_events |= AFD_POLL_RECEIVE_EXPEDITED;
|
||||
if (epoll_events & (EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND))
|
||||
afd_events |= AFD_POLL_SEND | AFD_POLL_CONNECT;
|
||||
afd_events |= AFD_POLL_SEND;
|
||||
if (epoll_events & (EPOLLIN | EPOLLRDNORM | EPOLLRDHUP))
|
||||
afd_events |= AFD_POLL_DISCONNECT;
|
||||
if (epoll_events & EPOLLHUP)
|
||||
@ -185,7 +185,7 @@ static inline uint32_t sock__afd_events_to_epoll_events(DWORD afd_events) {
|
||||
epoll_events |= EPOLLIN | EPOLLRDNORM;
|
||||
if (afd_events & AFD_POLL_RECEIVE_EXPEDITED)
|
||||
epoll_events |= EPOLLPRI | EPOLLRDBAND;
|
||||
if (afd_events & (AFD_POLL_SEND | AFD_POLL_CONNECT))
|
||||
if (afd_events & AFD_POLL_SEND)
|
||||
epoll_events |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
|
||||
if (afd_events & AFD_POLL_DISCONNECT)
|
||||
epoll_events |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user