close: add LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION allowed to send 30/168430/1 accepted/tizen/unified/20180129.073414 submit/tizen/20180126.083202
authorAndy Green <andy@warmcat.com>
Mon, 22 Jan 2018 23:01:21 +0000 (07:01 +0800)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 26 Jan 2018 12:22:58 +0000 (12:22 +0000)
https://github.com/warmcat/libwebsockets/issues/1159
(cherry picked from commit bd3d8d9de016b1408bee0e6717319e94dc92e048)

Conflicts:
lib/service.c

Change-Id: I298203267526fdf631a6a1660345176c5e8588b8
(cherry picked from commit 354262de94c8c3d9bdd3885ce075c3b81dd7b858)

lib/output.c
lib/service.c

index 465cb5f..c0ad1f8 100644 (file)
@@ -315,9 +315,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 */
 
index 2f703f8..1420f58 100644 (file)
@@ -1164,9 +1164,6 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t
                        break;
 
 read:
-               /* all the union members start with hdr, so even in ws mode
-                * we can deal with the ah via u.hdr
-                */
                if (wsi->u.hdr.ah) {
                        lwsl_info("%s: %p: inherited ah rx\n", __func__, wsi);
                        eff_buf.token_len = wsi->u.hdr.ah->rxlen -