From f1b30a39fd3e5ee58addd8c1cae8732024560810 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 23 Jan 2018 07:03:59 +0800 Subject: [PATCH] close: add LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION allowed to send https://github.com/warmcat/libwebsockets/issues/1159 --- lib/output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/output.c b/lib/output.c index c8b05cb9e..375ff3ef9 100644 --- a/lib/output.c +++ b/lib/output.c @@ -270,9 +270,12 @@ LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf, size_t len, if (wsi->state != LWSS_ESTABLISHED && ((wsi->state != LWSS_RETURNED_CLOSE_ALREADY && + wsi->state != LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION && wsi->state != LWSS_AWAITING_CLOSE_ACK) || - wp != LWS_WRITE_CLOSE)) + wp != LWS_WRITE_CLOSE)) { + lwsl_debug("binning\n"); return 0; + } /* if we are continuing a frame that already had its header done */