Software /
code /
prosody
Diff
net/server_epoll.lua @ 11658:36942fa001b4
net.server_epoll: Ensure timeout after closing
This should make sure that if there's data left to be written when
closing a connection, there's also a timeout so that it doesn't wait
forever.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 31 Oct 2020 00:33:29 +0100 |
parent | 11595:8985efc6792d |
child | 11659:00295a8e5bcf |
line wrap: on
line diff
--- a/net/server_epoll.lua Sun Jul 04 15:11:53 2021 +0200 +++ b/net/server_epoll.lua Sat Oct 31 00:33:29 2020 +0100 @@ -514,6 +514,7 @@ function interface:close() if self.writebuffer and self.writebuffer[1] then self:set(false, true); -- Flush final buffer contents + self:setwritetimeout(); self.write, self.send = noop, noop; -- No more writing self:debug("Close after writing remaining buffered data"); self.ondrain = interface.close;