The poll event driver (mainly used on Windows) is currently ignoring
POLLOUT and POLLERR events.
Because of this, the caller doesn't get notified that the connection
closed and can end up calling "event_wait" indefinitely.
This change ensures that POLLOUT and POLLERR events are properly
propagated by the poll driver.
Related issue: https://github.com/cloudbase/wnbd/issues/98
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
if (pfds[j].revents & POLLOUT) {
mask |= EVENT_WRITABLE;
}
+ if (pfds[j].revents & POLLHUP) {
+ mask |= EVENT_READABLE | EVENT_WRITABLE;
+ }
+ if (pfds[j].revents & POLLERR) {
+ mask |= EVENT_READABLE | EVENT_WRITABLE;
+ }
if (mask) {
fe.fd = pfds[j].fd;
fe.mask = mask;