unix_process/socket_user.c: call connection input handler on hangup
This commit changes the poll_spin() and epoll_spin() functions so
that the input handler of a connection is always called if the
connection is hung up. This ensures that all data associated with
the connection is properly deallocated.
@@ -284,13 +284,6 @@ static void poll_spin(notifier n)
#ifdef SOCKET_USER_EPOLL_DEBUG
rprintf(" fd %d, events %x, revents %x:\n", fds[i], fds[i].events, fds[i].revents);
#endif
- if (fds[i].revents & POLLHUP) {
- rprintf(" fd %d: POLLHUP, closing\n", fds[i].fd);
- notifier_reset_fd(n, fds[i].fd);
- // always the right thing to do?
- close(fds[i].fd);
- continue;
- }
registration r = vector_get(p->registrations, fds[i].fd);
do {
@@ -394,17 +387,10 @@ static void epoll_spin(notifier n)
#ifdef SOCKET_USER_EPOLL_DEBUG
rprintf(" fd %d, events %x\n", r->fd, ev[i].events);
#endif
- if (ev[i].events & EPOLLHUP) {
- descriptor fd = r->fd;
- notifier_reset_fd(n, fd);
- // always the right thing to do?
- close(fd);
- } else {
apply(r->a);
}
}
}
-}
notifier create_epoll_notifier(heap h)
{
