aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-12 20:12:04 +0200
committerKim Alvefur <zash@zash.se>2019-10-12 20:12:04 +0200
commitcabc1a2443672e086fd6e68ca8ca09f972450c82 (patch)
tree4a776184e33c642222560f1cd3d7f56b0d91c158 /net
parentec277db6ab17f16c5cb7b8a38b16d32db111868a (diff)
downloadprosody-cabc1a2443672e086fd6e68ca8ca09f972450c82.tar.gz
prosody-cabc1a2443672e086fd6e68ca8ca09f972450c82.zip
net.server_epoll: Handle getpeer/sockname returning a normal error
These will sometimes return nil, "Transport not connected" but not throw a hard error. This shouldn't be treated as success.
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 7a414901..3745b426 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -605,11 +605,11 @@ end
function interface:updatenames()
local conn = self.conn;
local ok, peername, peerport = pcall(conn.getpeername, conn);
- if ok then
+ if ok and peername then
self.peername, self.peerport = peername, peerport;
end
local ok, sockname, sockport = pcall(conn.getsockname, conn);
- if ok then
+ if ok and sockname then
self.sockname, self.sockport = sockname, sockport;
end
end