diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 96dcf07b..ac5da5d7 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -62,10 +62,6 @@ lws_free_wsi(struct lws *wsi) lws_free_set_NULL(wsi->rxflow_buffer); lws_free_set_NULL(wsi->trunc_alloc); - if (wsi->u.hdr.ah) - /* we're closing, losing some rx is OK */ - wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen; - /* we may not have an ah, but may be on the waiting list... */ lwsl_info("ah det due to close\n"); lws_header_table_detach(wsi, 0); @@ -154,6 +150,10 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason) } #endif + if (wsi->u.hdr.ah) + /* we're closing, losing some rx is OK */ + wsi->u.hdr.ah->rxpos = wsi->u.hdr.ah->rxlen; + context = wsi->context; pt = &context->pt[(int)wsi->tsi]; diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index 23ff6421..1a2fe5f8 100644 --- a/lib/lws-plat-unix.c +++ b/lib/lws-plat-unix.c @@ -140,7 +140,7 @@ lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) /* still somebody left who wants forced service? */ if (!lws_service_adjust_timeout(context, 1, pt->tid)) { /* yes... come back again later */ - lwsl_debug("%s: done again\n", __func__); + //lwsl_debug("%s: done again\n", __func__); } return 0; } diff --git a/lib/server.c b/lib/server.c index cc67e73b..72dcbedf 100644 --- a/lib/server.c +++ b/lib/server.c @@ -1798,8 +1798,6 @@ lws_server_socket_service(struct lws_context *context, struct lws *wsi, wsi->mode != LWSCM_HTTP_SERVING_ACCEPTED && wsi->mode != LWSCM_HTTP2_SERVING)) lws_header_table_detach(wsi, 1); - else - wsi->more_rx_waiting = 1; } break; }