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 | cce028c97a467f2d96f40ed147bf9975cec19249 (patch) | |
tree | f4465a1a7ea6b1422b136db2413a1ebdbb322a8a /net/server_epoll.lua | |
parent | 61789d01d9b260ee0201fe27f6fb71fc7507971e (diff) | |
download | prosody-cce028c97a467f2d96f40ed147bf9975cec19249.tar.gz prosody-cce028c97a467f2d96f40ed147bf9975cec19249.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; |