diff --git a/lib/service.c b/lib/service.c index edfaa324..60980948 100644 --- a/lib/service.c +++ b/lib/service.c @@ -1193,6 +1193,11 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, m++; } while (1); + /* explicitly detach the ah */ + + lws_header_table_force_to_detachable_state(wsi); + lws_header_table_detach(wsi, 0); + /* ... and then drop the connection */ if (wsi->desc.sockfd == our_fd)