Diff

net/server_epoll.lua @ 13571:ca041359c045

net.server_epoll: Don't try to flush buffer on closed connections Attempt to fix a bug where connections are somehow closed twice, leading to bad things happening elsewhere. With LuaSec, closed connections are generally already too closed to write anything to anyway since it does not support unidirectional shutdown.
author Kim Alvefur <zash@zash.se>
date Tue, 19 Nov 2024 00:41:02 +0100
parent 13570:9b9b224aa3f8
child 13652:a08065207ef0
line wrap: on
line diff
--- a/net/server_epoll.lua	Tue Nov 19 00:31:21 2024 +0100
+++ b/net/server_epoll.lua	Tue Nov 19 00:41:02 2024 +0100
@@ -508,7 +508,8 @@
 		end
 		if err == "closed" and self._connected then
 			self:debug("Connection closed by remote");
-			self:close(err);
+			self:on("disconnect", err);
+			self:destroy();
 			return;
 		elseif err ~= "timeout" then
 			self:debug("Read error, closing (%s)", err);