]> granicus.if.org Git - libevent/commit
Fix EV_CLOSED detection/reporting (epoll only)
authorAzat Khuzhin <azat@libevent.org>
Mon, 4 May 2020 21:21:18 +0000 (00:21 +0300)
committerAzat Khuzhin <azat@libevent.org>
Mon, 4 May 2020 21:25:23 +0000 (00:25 +0300)
commit972b456bf60e9a2f550ec45a14921c06e252c793
tree1a2618212597dd1f9919f68a22612564320ed7d1
parentc10cde4c617979e951352775a9685a47bf9c6acd
Fix EV_CLOSED detection/reporting (epoll only)

- EV_CLOSED is EPOLLRDHUP in epoll
- EPOLLRDHUP reported w/o EPOLLHUP if the socket closed with shutdown(SHUT_WR)
- EPOLLRDHUP reported w/  EPOLLHUP if the socket closed with close()
  so in this case epoll backend will detect this event as error
  (EV_READ|EV_WRITE), since the epoll_ctl() will return EPOLLRDHUP with
  EPOLLHUP set, but this is not correct, let's fix this.

Fixes: #984
epoll.c
test/regress.c