Software /
code /
prosody
Diff
net/http/server.lua @ 12833:8cbb109ff7ec
net.http.server: Close file handle earlier
Frees unneeded resources earlier, so they're not held on to while
potentially sending the chunk trailer.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 08 Jan 2023 13:51:30 +0100 |
parent | 12831:1cdaf21584da |
line wrap: on
line diff
--- a/net/http/server.lua Sun Jan 08 13:39:24 2023 +0100 +++ b/net/http/server.lua Sun Jan 08 13:51:30 2023 +0100 @@ -378,11 +378,11 @@ response.conn:write(chunk); else incomplete[response.conn] = nil; + if f.close then f:close(); end if chunked then response.conn:write("0\r\n\r\n"); end -- io.write("\n"); - if f.close then f:close(); end return response:done(); end end