aboutsummaryrefslogtreecommitdiffstats
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
commit3e8be00bbec2bfc691a2fd7fdb4dde33d39a55d4 (patch)
tree4a776184e33c642222560f1cd3d7f56b0d91c158
parent3585385ab60126105f7e0c7900399ec05c56a781 (diff)
downloadprosody-3e8be00bbec2bfc691a2fd7fdb4dde33d39a55d4.tar.gz
prosody-3e8be00bbec2bfc691a2fd7fdb4dde33d39a55d4.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.
-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