diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 3cdc6fa0..bf31d0a2 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -932,7 +932,8 @@ libwebsocket_service_fd(struct libwebsocket_context *context, /* handle session socket closed */ - if (pollfd->revents & (POLLERR | POLLHUP)) { + if ((!pollfd->revents & POLLIN) && + (pollfd->revents & (POLLERR | POLLHUP))) { lwsl_debug("Session Socket %p (fd=%d) dead\n", (void *)wsi, pollfd->fd);