diff options
author | Kim Alvefur <zash@zash.se> | 2024-11-19 00:41:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2024-11-19 00:41:02 +0100 |
commit | 61b0c0cd3ad805281ea5021278ecd6372296c9c5 (patch) | |
tree | 36f5b8b543c5e375a27ee7394a0e1fcf853fc988 | |
parent | ff00c6707ffaa8f176c1675548f33f975af743e1 (diff) | |
download | prosody-61b0c0cd3ad805281ea5021278ecd6372296c9c5.tar.gz prosody-61b0c0cd3ad805281ea5021278ecd6372296c9c5.zip |
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.
-rw-r--r-- | net/server_epoll.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index ce2782c1..b4477375 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -508,7 +508,8 @@ function interface:onreadable() 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); |