From c41d63004a6d20468ce114af258b7b156651e07f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 24 Nov 2023 00:31:08 +0100 Subject: net.http.server: Complete async waiter for non-persistent connections Otherwise requests with Connection: close would be stuck in the async wait that starts after the handle_request() call. Together with the new async debugging, this makes the async thread stay in the set of waiting runners forever, where previously it would simply be garbage collected. --- net/http/server.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'net/http') diff --git a/net/http/server.lua b/net/http/server.lua index 3d7d52b7..88907fcc 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -407,9 +407,8 @@ function _M.finish_response(response) response:on_destroy(); response.on_destroy = nil; end - if response.persistent then - response:finish_cb(); - else + response:finish_cb(); + if not response.persistent then response.conn:close(); end end -- cgit v1.2.3