From 1d393aba9eeb459af13f361a4c8aeffbef30bdfa Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 14 Feb 2017 09:26:53 +0800 Subject: [PATCH] client: close without spinning https://github.com/warmcat/libwebsockets/issues/789 --- lib/service.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/service.c b/lib/service.c index 0f6724012..0d4ec66cb 100644 --- a/lib/service.c +++ b/lib/service.c @@ -830,6 +830,8 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t #endif lwsl_debug("fd=%d, revents=%d\n", pollfd->fd, pollfd->revents); + if (pollfd->revents & LWS_POLLHUP) + goto close_and_handled; /* okay, what we came here to do... */