aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-02-01 00:33:08 +0100
committerKim Alvefur <zash@zash.se>2020-02-01 00:33:08 +0100
commit0f96c438e5b03eea8d1a1126333b99a3018c0bfb (patch)
treef4465a1a7ea6b1422b136db2413a1ebdbb322a8a /net/server_epoll.lua
parent668dc534b6bdf67e94042f3bb2c9671d1cacb0f3 (diff)
downloadprosody-0f96c438e5b03eea8d1a1126333b99a3018c0bfb.tar.gz
prosody-0f96c438e5b03eea8d1a1126333b99a3018c0bfb.zip
net.server_epoll: Different error to distinguish connection timeout
This mirrors what server_event does.
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 897bd111..fa247191 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -299,7 +299,7 @@ function interface:setwritetimeout(t)
else
self._writetimeout = addtimer(t, function ()
self:noise("Write timeout");
- self:on("disconnect", "write timeout");
+ self:on("disconnect", self._connected and "write timeout" or "connection timeout");
self:destroy();
end);
end
@@ -711,6 +711,7 @@ end
-- Connected!
function interface:onconnect()
+ self._connected = true;
self:updatenames();
self:debug("Connected (%s)", self);
self.onconnect = noop;