aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-10-31 00:33:29 +0100
committerKim Alvefur <zash@zash.se>2020-10-31 00:33:29 +0100
commit532fbe06878da9f0b10816be662f6aa7463b8f84 (patch)
treef17c429629842bdb88533c1723f954162b1475a4
parent31eb61f22ab37174e239038e44c5d7b40519afec (diff)
downloadprosody-532fbe06878da9f0b10816be662f6aa7463b8f84.tar.gz
prosody-532fbe06878da9f0b10816be662f6aa7463b8f84.zip
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.
-rw-r--r--net/server_epoll.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 25a50373..6618c204 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -514,6 +514,7 @@ interface.send = interface.write;
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;