From 649f602a18e6d9d18a38bd8ea654cb29728a07ba Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 15 Nov 2015 10:28:45 +0800 Subject: [PATCH] close actually close after send close ack Signed-off-by: Andy Green --- lib/service.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/service.c b/lib/service.c index 11c33b0c6..1b5dcf423 100644 --- a/lib/service.c +++ b/lib/service.c @@ -512,6 +512,8 @@ libwebsocket_service_fd(struct libwebsocket_context *context, wsi->state == WSI_STATE_RETURNED_CLOSE_ALREADY || wsi->state == WSI_STATE_FLUSHING_STORED_SEND_BEFORE_CLOSE) && lws_handle_POLLOUT_event(context, wsi, pollfd)) { + if (wsi->state == WSI_STATE_RETURNED_CLOSE_ALREADY) + wsi->state = WSI_STATE_FLUSHING_STORED_SEND_BEFORE_CLOSE; lwsl_info("libwebsocket_service_fd: closing\n"); goto close_and_handled; }