goto ERROR;
// Add the new socket to epoll()
- ev.events = EPOLLIN|EPOLLHUP;
+ ev.events = EPOLLIN|EPOLLRDHUP;
ev.data.fd = connfd;
if (epoll_ctl(epollfd, EPOLL_CTL_ADD, connfd, &ev)) {
// Handle any connection events
} else {
- if (ev.events & EPOLLHUP) {
+ if (events[i].events & EPOLLRDHUP) {
DEBUG(conf, "Connection %d has closed\n", fd);
// Remove the file descriptor from epoll()
}
// One of the connections had IO
- if (ev.events & EPOLLIN) {
+ if (events[i].events & EPOLLIN) {
r = handle_io_on_connection(conf, &stats, fd);
if (r < 0)
goto ERROR;