Let's move the detection of support for RDHUP earlier and out of the
FD update chain, as it complicates its simplification.
e = epoll_events[count].events;
fd = epoll_events[count].data.fd;
+ if ((e & EPOLLRDHUP) && !(cur_poller.flags & HAP_POLL_F_RDHUP))
+ _HA_ATOMIC_OR(&cur_poller.flags, HAP_POLL_F_RDHUP);
+
#ifdef DEBUG_FD
_HA_ATOMIC_INC(&fdtab[fd].event_count);
#endif
((e & EPOLLHUP) ? FD_EV_SHUT_RW : 0) |
((e & EPOLLERR) ? FD_EV_ERR_RW : 0);
- if ((e & EPOLLRDHUP) && !(cur_poller.flags & HAP_POLL_F_RDHUP))
- _HA_ATOMIC_OR(&cur_poller.flags, HAP_POLL_F_RDHUP);
-
fd_update_events(fd, n);
}
/* the caller will take care of cached events */
int e = poll_events[count].revents;
fd = poll_events[count].fd;
+ if ((e & POLLRDHUP) && !(cur_poller.flags & HAP_POLL_F_RDHUP))
+ _HA_ATOMIC_OR(&cur_poller.flags, HAP_POLL_F_RDHUP);
+
#ifdef DEBUG_FD
_HA_ATOMIC_INC(&fdtab[fd].event_count);
#endif
((e & POLLHUP) ? FD_EV_SHUT_RW : 0) |
((e & POLLERR) ? FD_EV_ERR_RW : 0);
- if ((e & POLLRDHUP) && !(cur_poller.flags & HAP_POLL_F_RDHUP))
- _HA_ATOMIC_OR(&cur_poller.flags, HAP_POLL_F_RDHUP);
-
fd_update_events(fd, n);
}