aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-01 14:26:11 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-01 14:26:11 +0100
commit6ccd66e347747b0fd7b2a193a777b46d913c38ee (patch)
treee3e96578751a5d9a50b8ad0f5705256072fc0776 /net/server_epoll.lua
parent610be29e2a98547251da98091c65ff3111664b69 (diff)
downloadprosody-6ccd66e347747b0fd7b2a193a777b46d913c38ee.tar.gz
prosody-6ccd66e347747b0fd7b2a193a777b46d913c38ee.zip
net.server_epoll: Handle missing ports from getsock/peername (as in the case of unix sockets)
Diffstat (limited to 'net/server_epoll.lua')
-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 82f7ab59..ded42c4d 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -619,11 +619,11 @@ function interface:updatenames()
local conn = self.conn;
local ok, peername, peerport = pcall(conn.getpeername, conn);
if ok and peername then
- self.peername, self.peerport = peername, peerport;
+ self.peername, self.peerport = peername, peerport or 0;
end
local ok, sockname, sockport = pcall(conn.getsockname, conn);
if ok and sockname then
- self.sockname, self.sockport = sockname, sockport;
+ self.sockname, self.sockport = sockname, sockport or 0;
end
end