Changeset

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
parents 11657:46fa1b939e88
children 11659:00295a8e5bcf
files net/http/files.lua net/server_epoll.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
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;