aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-11-24 00:31:08 +0100
committerKim Alvefur <zash@zash.se>2023-11-24 00:31:08 +0100
commitc41d63004a6d20468ce114af258b7b156651e07f (patch)
tree3b1889c9a0d96145ff7b5639d7615f8d9c550d90 /net
parent58988fbce5ff31a8e1c6d98d0e51e2757fe3add0 (diff)
downloadprosody-c41d63004a6d20468ce114af258b7b156651e07f.tar.gz
prosody-c41d63004a6d20468ce114af258b7b156651e07f.zip
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.
Diffstat (limited to 'net')
-rw-r--r--net/http/server.lua5
1 files changed, 2 insertions, 3 deletions
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