close: add LWSS_WAITING_TO_SEND_CLOSE_NOTIFICATION allowed to send

https://github.com/warmcat/libwebsockets/issues/1159
This commit is contained in:
Andy Green 2018-01-23 07:01:21 +08:00
parent 93f904f601
commit bd3d8d9de0
2 changed files with 4 additions and 4 deletions

View file

@ -278,9 +278,12 @@ LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf, size_t len,
if (!lws_state_is_ws(wsi->state) &&
((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 */

View file

@ -1591,9 +1591,6 @@ read:
break;
}
/* all the union members start with hdr, so even in ws mode
* we can deal with the ah via u.hdr
*/
if (wsi->ah) {
lwsl_info("%s: %p: inherited ah rx\n", __func__, wsi);
eff_buf.token_len = wsi->ah->rxlen -