diff options
author | Kim Alvefur <zash@zash.se> | 2020-02-01 00:33:08 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-02-01 00:33:08 +0100 |
commit | 0f96c438e5b03eea8d1a1126333b99a3018c0bfb (patch) | |
tree | f4465a1a7ea6b1422b136db2413a1ebdbb322a8a /net/server_epoll.lua | |
parent | 668dc534b6bdf67e94042f3bb2c9671d1cacb0f3 (diff) | |
download | prosody-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.lua | 3 |
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; |