diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 6c3598c0..a911cb74 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... */ lws_header_table_detach(wsi, 0); @@ -153,6 +149,10 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason) lws_access_log(wsi); + 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/server.c b/lib/server.c index e658b8e1..f244faed 100644 --- a/lib/server.c +++ b/lib/server.c @@ -1586,8 +1586,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; }