From 4bca6cd367824e54999295b7219c8833cf3d0247 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 26 Apr 2015 06:09:13 +0800 Subject: [PATCH] close also enable pollout processing for post send close state This should solve the 100% cpu at close problem reported by Bruce Perens Signed-off-by: Andy Green --- lib/service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/service.c b/lib/service.c index 4ae47c7..691861c 100644 --- a/lib/service.c +++ b/lib/service.c @@ -499,6 +499,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context, (wsi->state == WSI_STATE_ESTABLISHED || wsi->state == WSI_STATE_HTTP2_ESTABLISHED || wsi->state == WSI_STATE_HTTP2_ESTABLISHED_PRE_SETTINGS || + wsi->state == WSI_STATE_RETURNED_CLOSE_ALREADY || wsi->state == WSI_STATE_FLUSHING_STORED_SEND_BEFORE_CLOSE) && lws_handle_POLLOUT_event(context, wsi, pollfd)) { lwsl_info("libwebsocket_service_fd: closing\n"); -- 2.7.4